Skip to content

Commit b0de9ea

Browse files
Merge pull request #74 from chris13524/patch-1
fix: 0 tokens remaining should not be rate limited
2 parents 3a8cfb0 + 3e5a6b2 commit b0de9ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/single.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ export class RegionRatelimit extends Ratelimit<RegionContext> {
369369
[maxTokens, intervalDuration, refillRate, now],
370370
)) as [number, number];
371371

372-
const success = remaining > 0;
372+
const success = remaining >= 0;
373373
if (ctx.cache && !success) {
374374
ctx.cache.blockUntil(identifier, reset);
375375
}

0 commit comments

Comments
 (0)