Merge pull request #1342 from BerriAI/litellm_dockerfile_updates

build(Dockerfile): moves prisma logic to dockerfile
This commit is contained in:
Krish Dholakia 2024-01-06 16:03:25 +05:30 committed by GitHub
commit 8d32f08858
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 100 additions and 30 deletions

View file

@ -2424,6 +2424,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"