mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-22 00:31:44 +00:00
fix(router): type per-key spend totals without loop Final bindings
This commit is contained in:
parent
6cb7a6f600
commit
16e5642c25
1 changed files with 2 additions and 2 deletions
|
|
@ -677,12 +677,12 @@ class RouterBudgetLimiting(CustomLogger):
|
|||
for key, value in redis_values.items():
|
||||
if value is None:
|
||||
continue
|
||||
pending_spend: Final = sum(
|
||||
pending_spend = sum( # rebind-ok: each cache key has independent queued spend
|
||||
operation["increment_value"]
|
||||
for operation in self.redis_increment_operation_queue
|
||||
if operation["key"] == key
|
||||
)
|
||||
updated_spend: Final = float(value) + pending_spend
|
||||
updated_spend = float(value) + pending_spend # rebind-ok: each cache key has an independent total
|
||||
await self.dual_cache.in_memory_cache.async_set_cache(key=key, value=updated_spend)
|
||||
verbose_router_logger.debug("Updated in-memory cache for %s: %s", key, updated_spend)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue