We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
refilledAt
1 parent f4333e2 commit ede23d7Copy full SHA for ede23d7
pages/rate-limit/token-bucket.md
@@ -35,7 +35,7 @@ export class TokenBucketRateLimit<_Key> {
35
}
36
const refill = Math.floor((now - bucket.refilledAt) / (this.refillIntervalSeconds * 1000));
37
bucket.count = Math.min(bucket.count + refill, this.max);
38
- bucket.refilledAt = bucket.refilledAt + refill * this.refillIntervalSeconds;
+ bucket.refilledAt = bucket.refilledAt + refill * this.refillIntervalSeconds * 1000;
39
if (bucket.count < cost) {
40
return false;
41
0 commit comments