diff --git a/orchestrator/dispatch/main.go b/orchestrator/dispatch/main.go index 5cf2598..6850026 100644 --- a/orchestrator/dispatch/main.go +++ b/orchestrator/dispatch/main.go @@ -206,6 +206,11 @@ RUNCFG mkdir -p /opt/runner/work +# Idle guard: a runner whose job was cancelled or taken by another runner never gets one; it must not +# sit billing. No task dir after 10 min = shut down. Hard cap 75 min whatever happens. +shutdown -h +75 || true +( sleep 600; [ -z "$(ls -A /opt/runner/work 2>/dev/null)" ] && shutdown -h now ) & + # Run — blocks until the job completes, then exits (ephemeral = one job only) act_runner daemon --config .runner.yaml