chore: revert debug endpoint and smoke test to /health
This commit is contained in:
parent
540eeefe6e
commit
b1464bd065
|
|
@ -86,11 +86,6 @@ async def health():
|
||||||
return JSONResponse({"status": "ok", "service": APP_NAME})
|
return JSONResponse({"status": "ok", "service": APP_NAME})
|
||||||
|
|
||||||
|
|
||||||
@app.get("/debug-health")
|
|
||||||
async def debug_health():
|
|
||||||
return JSONResponse({"status": "debug-ok"})
|
|
||||||
|
|
||||||
|
|
||||||
# ── agent run ────────────────────────────────────────────────────────────────
|
# ── agent run ────────────────────────────────────────────────────────────────
|
||||||
@app.post("/run", response_model=RunResponse)
|
@app.post("/run", response_model=RunResponse)
|
||||||
async def run(req: RunRequest):
|
async def run(req: RunRequest):
|
||||||
|
|
|
||||||
|
|
@ -75,24 +75,24 @@ steps:
|
||||||
|
|
||||||
# Vent på at Cloud Run-instansen er klar (cold start kan ta opptil 90s)
|
# Vent på at Cloud Run-instansen er klar (cold start kan ta opptil 90s)
|
||||||
# Henter fersk token per forsøk siden token kan utløpe under lang cold start
|
# Henter fersk token per forsøk siden token kan utløpe under lang cold start
|
||||||
echo "Venter på /debug-health ..."
|
echo "Venter på /health ..."
|
||||||
sleep 30
|
sleep 30
|
||||||
STATUS="000"
|
STATUS="000"
|
||||||
for i in $$(seq 1 9); do
|
for i in $$(seq 1 9); do
|
||||||
TOKEN=$$(gcloud auth print-identity-token 2>/dev/null)
|
TOKEN=$$(gcloud auth print-identity-token 2>/dev/null)
|
||||||
if [ -z "$$TOKEN" ]; then
|
if [ -z "$$TOKEN" ]; then
|
||||||
echo " /debug-health forsøk $$i: kunne ikke hente token, venter..."
|
echo " /health forsøk $$i: kunne ikke hente token, venter..."
|
||||||
sleep 10
|
sleep 10
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
STATUS=$$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $$TOKEN" "$$BASE_URL/debug-health")
|
STATUS=$$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $$TOKEN" "$$BASE_URL/health")
|
||||||
echo " /debug-health forsøk $$i: HTTP $$STATUS"
|
echo " /health forsøk $$i: HTTP $$STATUS"
|
||||||
[ "$$STATUS" = "200" ] && break
|
[ "$$STATUS" = "200" ] && break
|
||||||
sleep 10
|
sleep 10
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$$STATUS" != "200" ]; then
|
if [ "$$STATUS" != "200" ]; then
|
||||||
echo "❌ /debug-health svarte ikke 200 etter 90s (siste: $$STATUS)"
|
echo "❌ /health svarte ikke 200 etter 90s (siste: $$STATUS)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user