feat: add Gitea readiness probe
CI / lint (pull_request) Successful in 9s
CI / build-frontend (pull_request) Successful in 5s

This commit is contained in:
timmy committed 2026-08-05 10:02:54 +00:00
1 parent a87e9d2db4
commit 610b659fd4
2 files changed
+57 -3

No files matched your search

+21
View File
@@ -30,6 +30,27 @@ def health() -> dict[str, str]:
return {"status": "ok", "service": "stackchain-dashboard"}
@app.get("/readyz")
async def readiness():
"""Return readiness after verifying the configured Gitea connection."""
try:
user = await current_user()
except Exception as exc:
return JSONResponse(
{
"status": "not_ready",
"service": "stackchain-dashboard",
"error": str(exc),
},
status_code=503,
)
return {
"status": "ready",
"service": "stackchain-dashboard",
"gitea_user": user["login"],
}
@app.get("/api/v1/context")
async def context() -> JSONResponse:
try: