Skip to content

Commit ccf8ae8

Browse files
committed
exit after run if warm starts disabled
1 parent 31b8559 commit ccf8ae8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,10 +691,12 @@ class ManagedRunController {
691691
// Kill the run process
692692
await this.taskRunProcess?.kill("SIGKILL");
693693

694-
const warmStartUrl = new URL(
695-
"/warm-start",
696-
env.TRIGGER_WARM_START_URL ?? env.TRIGGER_WORKER_API_URL
697-
);
694+
if (!env.TRIGGER_WARM_START_URL) {
695+
console.error("waitForNextRun: warm starts disabled, shutting down");
696+
process.exit(0);
697+
}
698+
699+
const warmStartUrl = new URL("/warm-start", env.TRIGGER_WARM_START_URL);
698700

699701
const res = await longPoll<DequeuedMessage>(
700702
warmStartUrl.href,
@@ -709,6 +711,7 @@ class ManagedRunController {
709711
"x-trigger-worker-instance-name": env.TRIGGER_WORKER_INSTANCE_NAME,
710712
},
711713
},
714+
// TODO: get these from the warm start service instead
712715
{
713716
timeoutMs: env.TRIGGER_WARM_START_CONNECTION_TIMEOUT_MS,
714717
totalDurationMs: env.TRIGGER_WARM_START_TOTAL_DURATION_MS,

0 commit comments

Comments
 (0)