Skip to content

Commit 2373a33

Browse files
committed
fix(webapp): resume syncs the fresh row's limit and honors a zero limit
Resume writes the engine limit from the row the update returned, so a concurrent deploy's change is not overwritten with a stale snapshot, and a declared limit of zero is written as zero instead of removing the limit and leaving the queue uncapped.
1 parent e3f7ed4 commit 2373a33

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,20 @@ export class PauseQueueService extends BaseService {
5757
},
5858
});
5959

60+
/**
61+
* Resume syncs from the row the update returned, never the pre-update
62+
* snapshot, so a limit changed by a concurrent deploy is not resurrected.
63+
* A declared limit of zero is a real limit and must be written, not removed.
64+
*/
6065
if (action === "paused") {
6166
await updateQueueConcurrencyLimits(environment, queue.name, 0);
6267
} else {
63-
if (queue.concurrencyLimit) {
64-
await updateQueueConcurrencyLimits(environment, queue.name, queue.concurrencyLimit);
68+
if (typeof updatedQueue.concurrencyLimit === "number") {
69+
await updateQueueConcurrencyLimits(
70+
environment,
71+
queue.name,
72+
updatedQueue.concurrencyLimit
73+
);
6574
} else {
6675
await removeQueueConcurrencyLimits(environment, queue.name);
6776
}

0 commit comments

Comments
 (0)