Skip to content

Commit a39c602

Browse files
committed
always wait at least 10ms to prevent event loop blocking
1 parent cf67b8a commit a39c602

File tree

2 files changed

+2
-2
lines changed
  • internal-packages/run-engine/src/batch-queue
  • packages/redis-worker/src/fair-queue

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ export class BatchQueue {
660660
break;
661661
}
662662
this.rateLimitDeniedCounter?.add(1);
663-
const waitMs = Math.max(0, (result.resetAt ?? Date.now()) - Date.now());
663+
const waitMs = Math.max(10, (result.resetAt ?? Date.now()) - Date.now());
664664
if (waitMs > 0) {
665665
await new Promise<void>((resolve, reject) => {
666666
const onAbort = () => {

packages/redis-worker/src/fair-queue/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ export interface FairQueueOptions<TPayloadSchema extends z.ZodTypeAny = z.ZodUnk
453453
* the queue is at or above this limit. This prevents unbounded worker queue
454454
* growth which could cause visibility timeouts (claimed messages have a
455455
* visibility timeout that ticks while they sit in the worker queue).
456-
* Requires `workerQueueId` to know which queue to check.
456+
* Requires `workerQueueDepthCheckId` to know which queue to check.
457457
* Disabled by default (0 = no limit).
458458
*/
459459
workerQueueMaxDepth?: number;

0 commit comments

Comments
 (0)