From 92dbd33e57f0a26fc8cdc8fde400802b9521a97d Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 1 Oct 2024 14:53:26 -0300 Subject: [PATCH] Update queue-worker.ts --- apps/api/src/services/queue-worker.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/api/src/services/queue-worker.ts b/apps/api/src/services/queue-worker.ts index 050d672d..b18f372b 100644 --- a/apps/api/src/services/queue-worker.ts +++ b/apps/api/src/services/queue-worker.ts @@ -148,6 +148,11 @@ const workerFun = async ( await redisConnection.zadd(concurrencyLimiterThrottledKey, now + throttledJobTimeoutMs, job.id); await job.moveToFailed(new Error("Concurrency limit hit"), token, false); await job.remove(); + let newJobPriority = Math.round((job.opts.priority ?? 10) * 1.01); + // max priority is 200k, limit is 2 million + if(newJobPriority > 200000) { + newJobPriority = 200000; + } await queue.add(job.name, { ...job.data, concurrencyLimitHit: true,