Skip to content

Commit 14058d5

Browse files
authored
fix: queues no longer unpaused on deploy (#2198)
1 parent 6535cf9 commit 14058d5

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

apps/webapp/app/v3/services/createBackgroundWorker.server.ts

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -380,26 +380,36 @@ async function createWorkerQueue(
380380
prisma
381381
);
382382

383-
if (typeof concurrencyLimit === "number") {
384-
logger.debug("createWorkerQueue: updating concurrency limit", {
385-
workerId: worker.id,
386-
taskQueue,
387-
orgId: environment.organizationId,
388-
projectId: environment.projectId,
389-
environmentId: environment.id,
390-
concurrencyLimit,
391-
});
392-
await updateQueueConcurrencyLimits(environment, taskQueue.name, concurrencyLimit);
383+
if (!taskQueue.paused) {
384+
if (typeof concurrencyLimit === "number") {
385+
logger.debug("createWorkerQueue: updating concurrency limit", {
386+
workerId: worker.id,
387+
taskQueue,
388+
orgId: environment.organizationId,
389+
projectId: environment.projectId,
390+
environmentId: environment.id,
391+
concurrencyLimit,
392+
});
393+
await updateQueueConcurrencyLimits(environment, taskQueue.name, concurrencyLimit);
394+
} else {
395+
logger.debug("createWorkerQueue: removing concurrency limit", {
396+
workerId: worker.id,
397+
taskQueue,
398+
orgId: environment.organizationId,
399+
projectId: environment.projectId,
400+
environmentId: environment.id,
401+
concurrencyLimit,
402+
});
403+
await removeQueueConcurrencyLimits(environment, taskQueue.name);
404+
}
393405
} else {
394-
logger.debug("createWorkerQueue: removing concurrency limit", {
406+
logger.debug("createWorkerQueue: queue is paused, not updating concurrency limit", {
395407
workerId: worker.id,
396408
taskQueue,
397409
orgId: environment.organizationId,
398410
projectId: environment.projectId,
399411
environmentId: environment.id,
400-
concurrencyLimit,
401412
});
402-
await removeQueueConcurrencyLimits(environment, taskQueue.name);
403413
}
404414

405415
return taskQueue;

0 commit comments

Comments
 (0)