mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(proxy/utils.py): support redis caching for alerting
This commit is contained in:
parent
cdae08f3c3
commit
9c0aecf9b8
1 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ class ProxyLogging:
|
|||
self.cache_control_check = _PROXY_CacheControlCheck()
|
||||
self.alerting: Optional[List] = None
|
||||
self.alerting_threshold: float = 300 # default to 5 min. threshold
|
||||
self.redis_usage_cache = redis_usage_cache
|
||||
self.internal_usage_cache = DualCache(redis_cache=redis_usage_cache)
|
||||
|
||||
def update_values(
|
||||
self, alerting: Optional[List], alerting_threshold: Optional[float]
|
||||
|
@ -332,7 +332,7 @@ class ProxyLogging:
|
|||
# - Alert once within 28d period
|
||||
# - Cache this information
|
||||
# - Don't re-alert, if alert already sent
|
||||
_cache: DualCache = self.call_details["user_api_key_cache"]
|
||||
_cache: DualCache = self.internal_usage_cache
|
||||
|
||||
# check if 5% of max budget is left
|
||||
if percent_left <= 0.05:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue