mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
style(router): explain mutable budget queue
This commit is contained in:
parent
2949c89bb9
commit
397b5c8bd6
1 changed files with 6 additions and 2 deletions
|
|
@ -532,14 +532,18 @@ class RouterBudgetLimiting(CustomLogger):
|
|||
|
||||
Only runs if Redis is initialized
|
||||
"""
|
||||
increment_operations_to_flush: list[RedisPipelineIncrementOperation] = []
|
||||
increment_operations_to_flush: list[RedisPipelineIncrementOperation] = ( # mutable-ok: Redis pipeline contract requires a list batch
|
||||
[] # mutable-ok: Redis pipeline batches are lists
|
||||
)
|
||||
try:
|
||||
if not self.dual_cache.redis_cache:
|
||||
return # Redis is not initialized
|
||||
|
||||
async with self._get_redis_increment_queue_lock():
|
||||
increment_operations_to_flush = self.redis_increment_operation_queue
|
||||
self.redis_increment_operation_queue = []
|
||||
self.redis_increment_operation_queue = (
|
||||
[] # mutable-ok: the emptied queue must remain appendable by logging callbacks
|
||||
)
|
||||
|
||||
verbose_router_logger.debug(
|
||||
"Pushing Redis Increment Pipeline for queue: %s",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue