Skip to content

Commit 2ae92de

Browse files
committed
initial test suite for sliding window log with spec update. closes #69
1 parent 5aec90f commit 2ae92de

File tree

2 files changed

+512
-1
lines changed

2 files changed

+512
-1
lines changed

src/rateLimiters/slidingWindowLog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { RateLimiter, RateLimiterResponse } from '../@types/rateLimit';
1313
* 2. Any requests that are older than window size are dropped from the log.
1414
* 3. The complexity of the current request is added to the complexity of all requests in the log.
1515
* 4. If the request exceeds the specified capacity it is dropped.
16-
* 5. Otherwise the request is allowed and ther current request is added to the log.
16+
* 5. Otherwise the request is allowed and the current request is added to the end of the log (if it has a complexity > 0).
1717
*/
1818
class SlidingWindowLog implements RateLimiter {
1919
private windowSize: number;

0 commit comments

Comments
 (0)