Skip to content

Commit d30d844

Browse files
committed
CLDSRV-810: Use rate limiting config in token bucket class
1 parent deb467c commit d30d844

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/api/apiUtils/rateLimit/tokenBucket.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class WorkerTokenBucket {
2929
this.log = log;
3030

3131
// Token buffer configuration
32-
this.bufferSize = config.tokenBucketBufferSize || 50; // Max tokens to hold
33-
this.refillThreshold = config.tokenBucketRefillThreshold || 20; // Trigger refill when below this
32+
this.bufferSize = config.rateLimiting?.tokenBucketBufferSize || 50; // Max tokens to hold
33+
this.refillThreshold = config.rateLimiting?.tokenBucketRefillThreshold || 20; // Trigger refill when below this
3434
this.tokens = this.bufferSize; // Start with full buffer for fail-open at startup
3535

3636
// Refill state

0 commit comments

Comments
 (0)