Skip to content

Commit 1ef964d

Browse files
committed
Fix JSDoc and comments
1 parent 605a606 commit 1ef964d

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

lib/api/apiUtils/rateLimit/gcra.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
* - 600 req/s ÷ 6 nodes = 100 req/s per node → interval = 100ms
1515
*
1616
* Dynamic work-stealing is achieved through Redis sync reconciliation:
17-
* - Each worker evaluates locally at its fixed per-worker quota
18-
* - Workers report consumed / workers to Redis
19-
* - Redis sums all workers' shares
20-
* - Workers overwrite local counters with Redis values
17+
* - Each worker evaluates locally using preallocated tokens
18+
* - Workers report processed requests to Redis
19+
* - Redis sums all workers' requests
2120
* - Idle workers' unused capacity accumulates in Redis
2221
* - Busy workers pull back higher emptyAt values and throttle proportionally
2322
*

lib/api/apiUtils/rateLimit/tokenBucket.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ class WorkerTokenBucket {
176176
/**
177177
* Get or create token bucket for a bucket
178178
*
179-
* @param {string} bucketName - Bucket name
179+
* @param {string} resourceClass - "bucket" or "account"
180+
* @param {string} resourceId - bucket name or account canonicalId
181+
* @param {string} measure - measure id e.g. "rps"
180182
* @param {object} limitConfig - Rate limit configuration
181183
* @param {object} log - Logger instance
182184
* @returns {WorkerTokenBucket}
@@ -244,7 +246,9 @@ function cleanupTokenBuckets(maxIdleMs = 60000) {
244246
/**
245247
* Remove a specific token bucket (used when rate limit config is deleted)
246248
*
247-
* @param {string} bucketName - Bucket name
249+
* @param {string} resourceClass - "bucket" or "account"
250+
* @param {string} resourceId - bucket name or account canonicalId
251+
* @param {string} measure - measure id e.g. "rps"
248252
* @returns {boolean} True if bucket was found and removed
249253
*/
250254
function removeTokenBucket(resourceClass, resourceId, measure) {

0 commit comments

Comments
 (0)