feat: add Gitea readiness probe
This commit is contained in:
1 parent
a87e9d2db4
commit
610b659fd4
2 files changed
+57
-3
No files matched your search
+21
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user