Skip to content

Commit 2d32e09

Browse files
committed
handle queued status change gracefully
1 parent 2c19693 commit 2d32e09

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/cli-v3/src/entryPoints/managed/execution.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,13 @@ export class RunExecution {
269269
this.abortExecution();
270270
return;
271271
}
272+
case "QUEUED": {
273+
this.sendDebugLog("Run was re-queued", snapshotMetadata);
274+
275+
// Pretend we've just suspended the run. This will kill the process without failing the run.
276+
await this.taskRunProcess?.suspend();
277+
return;
278+
}
272279
case "FINISHED": {
273280
this.sendDebugLog("Run is finished", snapshotMetadata);
274281

@@ -402,8 +409,7 @@ export class RunExecution {
402409

403410
return;
404411
}
405-
case "RUN_CREATED":
406-
case "QUEUED": {
412+
case "RUN_CREATED": {
407413
this.sendDebugLog("Invalid status change", snapshotMetadata);
408414

409415
this.abortExecution();

0 commit comments

Comments
 (0)