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.
1 parent ff74d90 commit 9df25e9Copy full SHA for 9df25e9
src/rateLimiters/slidingWindowCounter.ts
@@ -112,10 +112,10 @@ class SlidingWindowCounter implements RateLimiter {
112
};
113
114
// if request time is in a new window
115
- if (timestamp >= window.fixedWindowStart + this.windowSize + 1) {
+ if (timestamp >= window.fixedWindowStart + this.windowSize) {
116
updatedUserWindow.previousTokens = updatedUserWindow.currentTokens;
117
updatedUserWindow.currentTokens = 0;
118
- updatedUserWindow.fixedWindowStart = window.fixedWindowStart + this.windowSize + 1;
+ updatedUserWindow.fixedWindowStart = window.fixedWindowStart + this.windowSize;
119
}
120
121
// assigned to avoid TS error, this var will never be used as 0
0 commit comments