fix: align business reports and record task migration progress

This commit is contained in:
Yvan
2026-11-06 00:47:06 +08:00
parent 1bc2082718
commit b1f14bd525
32 changed files with 501 additions and 53 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -euo pipefail
# The HTTP listener starts after migrations. Large indexes have no meaningful
# fixed startup deadline; a stopped/restarted process is an actual failure.
started=$SECONDS
echo 'Waiting for backend startup and database migrations to finish...'
while true; do
state=$(docker inspect --format '{{.State.Running}} {{.RestartCount}}' sw2-backend) || exit 1
if [[ "$state" != 'true 0' ]]; then
echo "Backend exited or restarted during initialization ($state); check the migration logs." >&2
exit 1
fi
if curl -fsS --max-time 3 http://127.0.0.1:9602/health >/dev/null 2>&1; then
printf 'Backend ready after %s seconds.\n' "$((SECONDS - started))"
exit 0
fi
sleep 2
done