Skip to content

Commit e73626d

Browse files
committed
Clarify the envCurrentDequeuedKey usage
1 parent 54db95d commit e73626d

File tree

1 file changed

+9
-0
lines changed
  • internal-packages/run-engine/src/run-queue

1 file changed

+9
-0
lines changed

internal-packages/run-engine/src/run-queue/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,16 @@ export class RunQueue {
471471
);
472472
}
473473

474+
/**
475+
* Get the current concurrency of the environment
476+
* @param env - The environment to get the current concurrency of
477+
* @returns The current concurrency of the environment
478+
*/
474479
public async currentConcurrencyOfEnvironment(env: MinimalAuthenticatedEnvironment) {
480+
// We are now using the envCurrentDequeuedKey to track the current "displayed" concurrency of the environment
481+
// Operationally, we use the envCurrentConcurrencyKey to track the actual concurrency of the environment
482+
// The currentDequeuedKey is incremented when a message is dequeued from the worker queue,
483+
// wherease the currentConcurrencyKey is incremented when a message is dequeued from the message queue and put into the worker queue
475484
return this.redis.scard(this.keys.envCurrentDequeuedKey(env));
476485
}
477486

0 commit comments

Comments
 (0)