From d0afebacfd7c6fe4d9b4529fb07ee3df5734cf70 Mon Sep 17 00:00:00 2001 From: yassin Date: Sat, 29 Aug 2026 09:07:00 +0000 Subject: [PATCH] fix(health): keep readiness deadline fallback within lint budgets Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/proxy/health_endpoints/_health_endpoints.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/litellm/proxy/health_endpoints/_health_endpoints.py b/litellm/proxy/health_endpoints/_health_endpoints.py index 5306ba9e582..8b57bdca2fe 100644 --- a/litellm/proxy/health_endpoints/_health_endpoints.py +++ b/litellm/proxy/health_endpoints/_health_endpoints.py @@ -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