mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
style(proxy): satisfy ANN204 and SIM117 in the budget window spend writer
This commit is contained in:
parent
4e22a5ef5a
commit
6ef42f5991
2 changed files with 10 additions and 8 deletions
|
|
@ -275,13 +275,15 @@ async def commit_window_spend_updates(
|
|||
len(ordered),
|
||||
len(existing_primary_keys),
|
||||
)
|
||||
async with prisma_client.db.tx(timeout=_UPSERT_TRANSACTION_TIMEOUT) as db_transaction:
|
||||
async with db_transaction.batch_() as batcher:
|
||||
for transaction, seed_base in zip(ordered, seed_bases):
|
||||
batcher.execute_raw(
|
||||
_UPSERT_WINDOW_SPEND_SQL,
|
||||
*_upsert_params(transaction=transaction, seed_base=seed_base, now=now),
|
||||
)
|
||||
async with (
|
||||
prisma_client.db.tx(timeout=_UPSERT_TRANSACTION_TIMEOUT) as db_transaction,
|
||||
db_transaction.batch_() as batcher,
|
||||
):
|
||||
for transaction, seed_base in zip(ordered, seed_bases):
|
||||
batcher.execute_raw(
|
||||
_UPSERT_WINDOW_SPEND_SQL,
|
||||
*_upsert_params(transaction=transaction, seed_base=seed_base, now=now),
|
||||
)
|
||||
|
||||
|
||||
async def roll_window_spend_row(
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class WindowSpendUpdateQueue(BaseUpdateQueue):
|
|||
)
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.update_queue: asyncio.Queue[tuple[WindowSpendTransaction, ...]] = asyncio.Queue(
|
||||
maxsize=LITELLM_ASYNCIO_QUEUE_MAXSIZE
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue