mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
fix: use Python 3.10-compatible spend log timeout
This commit is contained in:
parent
445b209e42
commit
bea74c144e
1 changed files with 6 additions and 4 deletions
|
|
@ -6305,14 +6305,16 @@ async def update_spend_logs_job(
|
|||
logs_to_process: Final = await dequeue_spend_logs(prisma_client, MAX_LOGS_PER_INTERVAL)
|
||||
|
||||
try:
|
||||
async with asyncio.timeout(timeout):
|
||||
await ProxyUpdateSpend.update_spend_logs(
|
||||
await asyncio.wait_for(
|
||||
ProxyUpdateSpend.update_spend_logs(
|
||||
n_retry_times=n_retry_times,
|
||||
prisma_client=prisma_client,
|
||||
proxy_logging_obj=proxy_logging_obj,
|
||||
db_writer_client=db_writer_client,
|
||||
logs_to_process=logs_to_process,
|
||||
)
|
||||
),
|
||||
timeout=timeout,
|
||||
)
|
||||
except asyncio.CancelledError:
|
||||
await enqueue_spend_logs(prisma_client, logs_to_process, at_head=True)
|
||||
verbose_proxy_logger.warning(
|
||||
|
|
@ -6320,7 +6322,7 @@ async def update_spend_logs_job(
|
|||
len(logs_to_process),
|
||||
)
|
||||
raise
|
||||
except TimeoutError:
|
||||
except asyncio.TimeoutError:
|
||||
await enqueue_spend_logs(prisma_client, logs_to_process, at_head=True)
|
||||
verbose_proxy_logger.warning(
|
||||
"Spend tracking - spend log write timed out after %.2f seconds; requeued %d rows",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue