fix: alert on degraded community scheduler health
CI / backend-and-migrations (push) Canceled after 0s
CI / astro-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s
CI / compose-e2e (push) Canceled after 0s

This commit is contained in:
ik
2026-09-11 07:44:30 +07:00
parent 5b2db1cf48
commit d6bc5ce85c
+12
View File
@@ -45,6 +45,18 @@ done
ready_payload=$(curl -fsS --max-time 10 "$base_url/ready" 2>/dev/null) || ready_payload=""
printf '%s' "$ready_payload" | grep -Eq '"status"[[:space:]]*:[[:space:]]*"ready"' || fail "readiness"
# Import health is intentionally non-blocking for /ready, but must still alert.
# Parse the nested component instead of accepting any unrelated "ready" field.
community_status=$(printf '%s' "$ready_payload" | python3 -c 'import json,sys
try:
payload=json.load(sys.stdin)
print(payload.get("components",{}).get("community_scheduler",{}).get("status", "unknown"))
except Exception:
print("unknown")')
case "$community_status" in
ready) : ;;
*) fail "community-scheduler:${community_status}" ;;
esac
disk_used=$(df -Pk "$repo" | awk 'NR==2 {gsub(/%/, "", $5); print $5}')
case "$disk_used" in