From 1f72ae5442b1198c16d607173b9ebee2eb8ae363 Mon Sep 17 00:00:00 2001 From: harish-berri Date: Thu, 30 Apr 2026 22:06:33 +0000 Subject: [PATCH] fix: add type hint ignore for user_api_key_cache and update docstring for EventDrivenCacheCoordinator --- litellm/proxy/auth/user_api_key_auth.py | 2 +- litellm/proxy/common_utils/cache_coordinator.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/auth/user_api_key_auth.py b/litellm/proxy/auth/user_api_key_auth.py index d87bd9e7d59..b13e6cebf97 100644 --- a/litellm/proxy/auth/user_api_key_auth.py +++ b/litellm/proxy/auth/user_api_key_auth.py @@ -345,7 +345,7 @@ async def _fetch_global_spend_with_event_coordination( return await _global_spend_coordinator.get_or_load( cache_key=cache_key, - cache=user_api_key_cache, + cache=user_api_key_cache, # pyright: ignore[reportArgumentType] load_fn=_load_global_spend, ) diff --git a/litellm/proxy/common_utils/cache_coordinator.py b/litellm/proxy/common_utils/cache_coordinator.py index 92d9916098d..fc46ab6d78e 100644 --- a/litellm/proxy/common_utils/cache_coordinator.py +++ b/litellm/proxy/common_utils/cache_coordinator.py @@ -52,6 +52,9 @@ class EventDrivenCacheCoordinator: - Other requests: wait for the signal, then read from cache. Create one instance per resource (e.g. one for global spend, one for feature flags). + + Args: + log_prefix: Prefix for debug log messages. """ def __init__(self, log_prefix: str = "[CACHE]"): @@ -150,7 +153,7 @@ class EventDrivenCacheCoordinator: elapsed_ms, value, ) - + await cache.async_set_cache(key=cache_key, value=value) if self._log_prefix: verbose_proxy_logger.debug("%s Result cached", self._log_prefix)