From 20966501a8e84b9e4fa0ed0ff8231e7908d4da63 Mon Sep 17 00:00:00 2001 From: Xika Date: Wed, 1 Jul 2026 01:23:15 +0000 Subject: [PATCH] fix(deploy): retry API health check after container restart After --force-recreate web, the API container can take >10s to become healthy. Retry up to 5 times with 5s backoff so transient startup latency doesn't mark a successful deploy as failed. Co-Authored-By: Paperclip --- deploy/deploy-pull.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deploy/deploy-pull.sh b/deploy/deploy-pull.sh index 73c85f2..5316434 100644 --- a/deploy/deploy-pull.sh +++ b/deploy/deploy-pull.sh @@ -56,7 +56,12 @@ log "Building API + worker ($GIT_SHA)" log "Building admin UI ($GIT_SHA)" $COMPOSE build --build-arg GIT_SHA="$GIT_SHA" web $COMPOSE up -d --force-recreate web - curl -sf --max-time 10 http://127.0.0.1:8000/api/health >/dev/null + for i in 1 2 3 4 5; do + curl -sf --max-time 8 http://127.0.0.1:8000/api/health >/dev/null && break + log "API not ready yet (attempt $i/5), retrying in 5s..." + sleep 5 + done + curl -sf --max-time 8 http://127.0.0.1:8000/api/health >/dev/null write_status "ok $GIT_SHA $(date -Iseconds)" log "Deploy OK ($GIT_SHA)" log "Refreshing deploy-hook (self-restart — runs detached)"