mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
fix(health): keep readiness deadline fallback within lint budgets
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
ed72aa9d3c
commit
d0afebacfd
1 changed files with 3 additions and 6 deletions
|
|
@ -1380,20 +1380,17 @@ DB_READINESS_CHECK_TIMEOUT_SECONDS: Final = 2.0
|
|||
DB_READINESS_PROBE_DEADLINE_SECONDS: Final = 4.0
|
||||
|
||||
|
||||
async def _db_health_readiness_check():
|
||||
global db_health_cache
|
||||
|
||||
async def _db_health_readiness_check() -> DBHealthCache:
|
||||
try:
|
||||
return await asyncio.wait_for(
|
||||
_db_health_readiness_check_unbounded(),
|
||||
timeout=DB_READINESS_PROBE_DEADLINE_SECONDS,
|
||||
)
|
||||
except asyncio.TimeoutError:
|
||||
db_health_cache = {"status": "disconnected", "last_updated": datetime.now()}
|
||||
return db_health_cache
|
||||
return {"status": "disconnected", "last_updated": db_health_cache["last_updated"]}
|
||||
|
||||
|
||||
async def _db_health_readiness_check_unbounded():
|
||||
async def _db_health_readiness_check_unbounded() -> DBHealthCache:
|
||||
from litellm.proxy.proxy_server import prisma_client
|
||||
|
||||
global db_health_cache
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue