Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 23 additions & 13 deletions apps/webapp/app/v3/services/createBackgroundWorker.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,26 +380,36 @@ async function createWorkerQueue(
prisma
);

if (typeof concurrencyLimit === "number") {
logger.debug("createWorkerQueue: updating concurrency limit", {
workerId: worker.id,
taskQueue,
orgId: environment.organizationId,
projectId: environment.projectId,
environmentId: environment.id,
concurrencyLimit,
});
await updateQueueConcurrencyLimits(environment, taskQueue.name, concurrencyLimit);
if (!taskQueue.paused) {
if (typeof concurrencyLimit === "number") {
logger.debug("createWorkerQueue: updating concurrency limit", {
workerId: worker.id,
taskQueue,
orgId: environment.organizationId,
projectId: environment.projectId,
environmentId: environment.id,
concurrencyLimit,
});
await updateQueueConcurrencyLimits(environment, taskQueue.name, concurrencyLimit);
} else {
logger.debug("createWorkerQueue: removing concurrency limit", {
workerId: worker.id,
taskQueue,
orgId: environment.organizationId,
projectId: environment.projectId,
environmentId: environment.id,
concurrencyLimit,
});
await removeQueueConcurrencyLimits(environment, taskQueue.name);
}
} else {
logger.debug("createWorkerQueue: removing concurrency limit", {
logger.debug("createWorkerQueue: queue is paused, not updating concurrency limit", {
workerId: worker.id,
taskQueue,
orgId: environment.organizationId,
projectId: environment.projectId,
environmentId: environment.id,
concurrencyLimit,
});
await removeQueueConcurrencyLimits(environment, taskQueue.name);
}

return taskQueue;
Expand Down