mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-13 08:52:02 +00:00
fix(router): read health states without a catch-all, DualCache already swallows read errors
This commit is contained in:
parent
6d019c9dc8
commit
5881fc4a0e
1 changed files with 2 additions and 10 deletions
|
|
@ -108,20 +108,12 @@ class DeploymentHealthCache:
|
|||
@with_service_target(HEALTH_CHECKS_TARGET)
|
||||
async def async_get_states(self) -> object:
|
||||
"""Every deployment's raw state, as the router core's health filter reads it; a failed read is None."""
|
||||
try:
|
||||
return await self.cache.async_get_cache(key=self.CACHE_KEY) # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType] # DualCache's reads are untyped
|
||||
except Exception as e:
|
||||
verbose_logger.debug("DeploymentHealthCache::async_get_states - Exception: %s", str(e))
|
||||
return None
|
||||
return await self.cache.async_get_cache(key=self.CACHE_KEY) # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType] # DualCache's reads are untyped
|
||||
|
||||
@with_service_target(HEALTH_CHECKS_TARGET)
|
||||
def get_states(self) -> object:
|
||||
"""``async_get_states`` for a sync call."""
|
||||
try:
|
||||
return self.cache.get_cache(key=self.CACHE_KEY) # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType] # DualCache's reads are untyped
|
||||
except Exception as e:
|
||||
verbose_logger.debug("DeploymentHealthCache::get_states - Exception: %s", str(e))
|
||||
return None
|
||||
return self.cache.get_cache(key=self.CACHE_KEY) # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType] # DualCache's reads are untyped
|
||||
|
||||
@with_service_target(HEALTH_CHECKS_TARGET)
|
||||
async def async_get_unhealthy_deployment_ids(self, parent_otel_span: Span | None = None) -> set[str]:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue