add code for level 4
This commit is contained in:
+3
-1
@@ -79,7 +79,9 @@ async def liveness() -> dict[str, str]:
|
||||
return {"status": "ok"}
|
||||
|
||||
@router.get("/health/ready")
|
||||
async def readiness(store: PostgresStore = Depends(get_store)) -> dict[str, str]:
|
||||
async def readiness(request: Request, store: PostgresStore = Depends(get_store)) -> dict[str, str]:
|
||||
if not request.app.state.accepting_requests:
|
||||
raise ApiError(503, "unavailable", "API завершает работу")
|
||||
await store.ready()
|
||||
return {"status": "ok"}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user