Skip to content

Commit

Permalink
we should only limit when the counter is strictly bigger than the lim…
Browse files Browse the repository at this point in the history
…it and we should call global from configure as a fallback
  • Loading branch information
rokob committed Oct 17, 2017
1 parent eb83a3f commit 2d40b94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/rateLimiter.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ RateLimiter.prototype.setPlatformOptions = function(platform, options) {
/* Helpers */

function checkRate(item, limit, counter) {
return !item.ignoreRateLimit && limit >= 1 && counter >= limit;
return !item.ignoreRateLimit && limit >= 1 && counter > limit;
}

function shouldSendValue(platform, options, error, shouldSend, globalRateLimit) {
Expand Down
1 change: 1 addition & 0 deletions src/rollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Rollbar.prototype.configure = function(options, payloadData) {
payload = {payload: payloadData};
}
this.options = _.extend(true, {}, oldOptions, options, payload);
this.global(this.options);
return this;
};

Expand Down

0 comments on commit 2d40b94

Please sign in to comment.