mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix: better debug logs
This commit is contained in:
parent
e0d3b18835
commit
f6de3a0359
3 changed files with 13 additions and 8 deletions
|
@ -1817,6 +1817,7 @@ async def reset_budget(prisma_client: PrismaClient):
|
|||
|
||||
Updates db
|
||||
"""
|
||||
verbose_proxy_logger.debug("ENTERS RESET BUDGET")
|
||||
if prisma_client is not None:
|
||||
### RESET KEY BUDGET ###
|
||||
now = datetime.utcnow()
|
||||
|
@ -1828,12 +1829,15 @@ async def reset_budget(prisma_client: PrismaClient):
|
|||
)
|
||||
|
||||
### RESET USER BUDGET ###
|
||||
asyncio.create_task(
|
||||
prisma_client.db.litellm_usertable.update_many(
|
||||
verbose_proxy_logger.debug("STARTS RESETTING USER BUDGET")
|
||||
try:
|
||||
await prisma_client.db.litellm_usertable.update_many(
|
||||
where={"budget_reset_at": {"lt": now}},
|
||||
data={"spend": 0, "budget_reset_at": now},
|
||||
)
|
||||
)
|
||||
except Exception as e:
|
||||
verbose_proxy_logger.debug(f"An exception occurs - {str(e)}")
|
||||
raise e
|
||||
|
||||
|
||||
async def update_spend(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue