fix(proxy_server.py): improve /health/readiness endpoint to give more details on connected services

This commit is contained in:
Krrish Dholakia 2024-01-08 17:45:00 +05:30 committed by ishaan-jaff
parent b061edf4d0
commit 30d738c83c

View file

@ -2480,9 +2480,9 @@ async def health_readiness():
global prisma_client global prisma_client
if prisma_client is not None: # if db passed in, check if it's connected if prisma_client is not None: # if db passed in, check if it's connected
if prisma_client.db.is_connected() == True: if prisma_client.db.is_connected() == True:
return {"status": "healthy"} return {"status": "healthy", "db": "connected"}
else: else:
return {"status": "healthy"} return {"status": "healthy", "db": "Not connected"}
raise HTTPException(status_code=503, detail="Service Unhealthy") raise HTTPException(status_code=503, detail="Service Unhealthy")