mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-12 08:16:37 +08:00
Wait longer for smoke startup
This commit is contained in:
+14
-4
@@ -119,12 +119,22 @@ MEDIASTATION_CACHE_CACHE_DIR="$CACHE" \
|
|||||||
"$BIN" >"$LOG" 2>&1 &
|
"$BIN" >"$LOG" 2>&1 &
|
||||||
PID=$!
|
PID=$!
|
||||||
|
|
||||||
# Wait until /api/health responds.
|
# Wait until /api/health responds. CI runners can be slow immediately after
|
||||||
for _ in $(seq 1 20); do
|
# building the binary, so give startup a full minute before failing.
|
||||||
curl -s -o /dev/null "http://127.0.0.1:$PORT/api/health" && break
|
HEALTH_OK=0
|
||||||
|
for _ in $(seq 1 120); do
|
||||||
|
if curl -s -o /dev/null "http://127.0.0.1:$PORT/api/health"; then
|
||||||
|
HEALTH_OK=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
done
|
done
|
||||||
curl -s "http://127.0.0.1:$PORT/api/health" | grep -q '"ok"' && ok "/api/health" || fail "/api/health"
|
if [ "$HEALTH_OK" = 1 ] && curl -s "http://127.0.0.1:$PORT/api/health" | grep -q '"ok"'; then
|
||||||
|
ok "/api/health"
|
||||||
|
else
|
||||||
|
fail "/api/health"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# --- 3. Auth ----------------------------------------------------------------
|
# --- 3. Auth ----------------------------------------------------------------
|
||||||
hdr "Auth"
|
hdr "Auth"
|
||||||
|
|||||||
Reference in New Issue
Block a user