fix: 修复bug

This commit is contained in:
Daniel
2026-03-25 16:59:05 +08:00
parent a2f224d01f
commit 34786b37c7
5 changed files with 53 additions and 25 deletions

8
dev.sh
View File

@@ -21,15 +21,17 @@ case "$CMD" in
# Start in background, then wait for Node self-check + health endpoint.
docker compose up -d --build "$@"
echo "[dev] waiting for server health..."
deadline=$((SECONDS + 90))
# ComfyUI first startup may take longer while preparing custom nodes.
HEALTH_TIMEOUT_SECONDS="${HEALTH_TIMEOUT_SECONDS:-300}"
deadline=$((SECONDS + HEALTH_TIMEOUT_SECONDS))
ok=0
while [ $SECONDS -lt $deadline ]; do
if curl -fsS "http://127.0.0.1:3000/api/health" >/dev/null 2>&1; then
ok=1
break
fi
# If container exited, fail fast.
if ! docker compose ps --status running | grep -q "aivideo"; then
# Fail fast only if container actually exited (avoid mis-detecting "starting" state).
if docker compose ps --status exited | grep -q "aivideo"; then
break
fi
sleep 1