#!/usr/bin/env bash
# English comments only
set -euo pipefail
URL="${HS_READY_URL:-http://127.0.0.1:8000/health/ready}"
for i in {1..60}; do
  if curl -fsS "$URL" >/dev/null; then
    echo "[wait-hs] ready"
    exit 0
  fi
  sleep 2
done
echo "[wait-hs] timeout waiting for $URL" >&2
exit 1
