28 lines
664 B
Bash
Executable File
28 lines
664 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "${ROOT_DIR}"
|
|
|
|
BASE_URL="${GATEWAY_BASE_URL:-http://127.0.0.1:8787}"
|
|
|
|
wait_health() {
|
|
local attempts=60
|
|
for _ in $(seq 1 "${attempts}"); do
|
|
if curl -fsS "${BASE_URL}/health" >/dev/null 2>&1; then
|
|
return 0
|
|
fi
|
|
sleep 2
|
|
done
|
|
echo "ERROR: gateway did not become healthy at ${BASE_URL}/health" >&2
|
|
return 1
|
|
}
|
|
|
|
wait_health
|
|
|
|
curl -fsS -X POST "${BASE_URL}/query" \
|
|
-H 'content-type: application/json' \
|
|
-d '{"branch":"main","query_type":"search","query":"router","require_latest":true,"debug":true}' >/dev/null
|
|
|
|
echo "Warmup completed."
|