Add a switch to turn job dispatch off, and use it in the dev stack

The scheduler sends a queued job to any idle claimed printer in any farm.
The dashboard dev stack is wired to the real printers, so testing the job
upload UI there would have started a real print on the first idle one.

DISPATCH_ENABLED=false (exactly that string) disables the timer and the
nudge from POST /jobs; any other value that looks like an attempt to
disable it is warned about, because a typo that silently leaves it on is
the dangerous direction. scripts/e2e-camera.sh now always runs the backend
with it off.
This commit is contained in:
2026-10-29 14:35:40 +00:00
parent 705336b422
commit 6a2457315e
5 changed files with 63 additions and 1 deletions
+5 -1
View File
@@ -245,7 +245,11 @@ if [ "$AUTH" = "dev" ]; then
else
echo "==> starting the backend on :$PORT, verifying tokens against the real Supabase JWKS"
fi
bun run src/index.ts > "$WORK/backend.log" 2>&1 &
# The scheduler would send any queued job to any idle printer in the fleet - and
# this stack is wired to the real ones. Off, always: a job queued while working
# on the dashboard must never become a real print. (Dispatch is exercised
# against fakes by the other e2e scripts.)
DISPATCH_ENABLED=false bun run src/index.ts > "$WORK/backend.log" 2>&1 &
BACKEND_PID=$!
for _ in $(seq 1 60); do curl -sf "$BASE/health" >/dev/null 2>&1 && break; sleep 0.5; done
curl -sf "$BASE/health" >/dev/null || fail "backend did not become healthy"