Skip to content

Commit e424c44

Browse files
committed
fix for finished runs waiting forever
1 parent 7f62aee commit e424c44

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/cli-v3/src/entryPoints/managed-run-controller.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,15 @@ class ManagedRunController {
579579
runId: run.friendlyId,
580580
message: "Run is finished, will wait for next run",
581581
});
582-
this.waitForNextRun();
582+
583+
if (this.activeRunExecution) {
584+
// Let's pretend we've just suspended the run. This will kill the process and should automatically wait for the next run.
585+
// We still explicitly call waitForNextRun() afterwards in case of race conditions. Locks will prevent this from causing issues.
586+
await this.taskRunProcess?.suspend();
587+
}
588+
589+
this.waitForNextRun();
590+
583591
return;
584592
}
585593
case "QUEUED_EXECUTING":

0 commit comments

Comments
 (0)