Skip to content

Commit

Permalink
Fix longLimiter using the short period
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovyerus committed Oct 18, 2017
1 parent f320e34 commit 23a8fa2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const Ratelimiter = require('./Ratelimiter');
*
* @prop {String} key API key
* @prop {Number} numRes Amount of responses returned from the API.
* @prop {?Number} shortRemaining Amount of requests left during the "short" period before you get ratelimited. Will be null before the first request.
* @prop {?Number} longRemaining Amount of requests left during the "long" period before you get ratelimited. Will be null before the first request.
* @prop {Ratelimiter} shortLimiter Ratelimiter object that takes care of the short period, usually 30 seconds.
* @prop {Ratelimiter} longLimiter Ratelimiter object that takes care of the long period, usually 24 hours.
*/
class Handler {
/**
Expand All @@ -34,7 +34,7 @@ class Handler {
this.numRes = options.numRes != null ? options.numRes : 5;
this.getRating = options.getRating || false;
this.shortLimiter = new Ratelimiter(20, PERIODS.SHORT); // 20 uses every 30 seconds
this.longLimiter = new Ratelimiter(300, PERIODS.SHORT); // 300 uses every 24 hours
this.longLimiter = new Ratelimiter(300, PERIODS.LONG); // 300 uses every 24 hours
}

/**
Expand Down

0 comments on commit 23a8fa2

Please sign in to comment.