Remote checks fail fast when the worker is down and no longer pile up

While the worker was stopped (maintenance), checks were queued with nobody to
run them; agents timed out ("fetch failed", 502 after a restart) and every
retry queued another copy. Now: the worker writes a heartbeat and a check is
refused with 503 at once while it is down; a retry of the same files joins
the job already queued or running; a job nobody waits for any more is
dropped. TD_KEEP_WORKER=1 deploys without touching the worker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNwtXPYqFu3oKaaXwYwNWW
This commit is contained in:
Saty 2026-10-18 05:00:59 +02:00
commit 9cfa55c9b2
6 changed files with 73 additions and 20 deletions

View file

@ -1,6 +1,7 @@
#!/bin/sh
# Deploys the committed HEAD to the coordinator without taking the site down (deploy/update.sh).
# tools/deploy.sh [--td]
# TD_KEEP_WORKER=1 tools/deploy.sh leaves the worker as it is (see deploy/update.sh).
# --td also publishes the td binaries from dist/ (node tools/build-td/build.mjs) for download and
# self-update. TD_HOST names the ssh host (default: td-server).
set -eu
@ -30,5 +31,5 @@ ssh "$HOST" "set -e
chmod 0755 \$D/td-linux-x64
echo 'td binaries published'
fi
sh \"\$d/deploy/update.sh\" \"\$d\"
TD_KEEP_WORKER='${TD_KEEP_WORKER:-}' sh \"\$d/deploy/update.sh\" \"\$d\"
rm -rf \"\$d\""