build(Dockerfile): moves prisma logic to dockerfile

This commit is contained in:
Krrish Dholakia 2024-01-06 14:59:10 +05:30
parent cd98d256b5
commit 7434f1a300
4 changed files with 99 additions and 32 deletions

View file

@ -2255,6 +2255,28 @@ async def health_endpoint(
}
@router.get("/health/readiness", tags=["health"])
async def health_readiness():
"""
Unprotected endpoint for checking if worker can receive requests
"""
global prisma_client
if prisma_client is not None: # if db passed in, check if it's connected
if prisma_client.db.is_connected() == True:
return {"status": "healthy"}
else:
return {"status": "healthy"}
raise HTTPException(status_code=503, detail="Service Unhealthy")
@router.get("/health/liveliness", tags=["health"])
async def health_liveliness():
"""
Unprotected endpoint for checking if worker is alive
"""
return "I'm alive!"
@router.get("/")
async def home(request: Request):
return "LiteLLM: RUNNING"