forked from phoenix/litellm-mirror
fix: better debug logs
This commit is contained in:
parent
e0d3b18835
commit
f6de3a0359
3 changed files with 13 additions and 8 deletions
|
@ -53,11 +53,6 @@ RUN pip install *.whl /wheels/* --no-index --find-links=/wheels/ && rm -f *.whl
|
||||||
# install semantic-cache [Experimental]- we need this here and not in requirements.txt because redisvl pins to pydantic 1.0
|
# install semantic-cache [Experimental]- we need this here and not in requirements.txt because redisvl pins to pydantic 1.0
|
||||||
RUN pip install redisvl==0.0.7 --no-deps
|
RUN pip install redisvl==0.0.7 --no-deps
|
||||||
|
|
||||||
# ensure pyjwt is used, not jwt
|
|
||||||
RUN pip uninstall jwt -y
|
|
||||||
RUN pip uninstall PyJWT -y
|
|
||||||
RUN pip install PyJWT --no-cache-dir
|
|
||||||
|
|
||||||
# Build Admin UI
|
# Build Admin UI
|
||||||
RUN chmod +x build_admin_ui.sh && ./build_admin_ui.sh
|
RUN chmod +x build_admin_ui.sh && ./build_admin_ui.sh
|
||||||
|
|
||||||
|
|
|
@ -2652,6 +2652,12 @@ async def startup_event():
|
||||||
### START BUDGET SCHEDULER ###
|
### START BUDGET SCHEDULER ###
|
||||||
if prisma_client is not None:
|
if prisma_client is not None:
|
||||||
scheduler = AsyncIOScheduler()
|
scheduler = AsyncIOScheduler()
|
||||||
|
verbose_proxy_logger.debug(
|
||||||
|
f"proxy_budget_rescheduler_max_time: {proxy_budget_rescheduler_max_time}"
|
||||||
|
)
|
||||||
|
verbose_proxy_logger.debug(
|
||||||
|
f"proxy_budget_rescheduler_min_time: {proxy_budget_rescheduler_min_time}"
|
||||||
|
)
|
||||||
interval = random.randint(
|
interval = random.randint(
|
||||||
proxy_budget_rescheduler_min_time, proxy_budget_rescheduler_max_time
|
proxy_budget_rescheduler_min_time, proxy_budget_rescheduler_max_time
|
||||||
) # random interval, so multiple workers avoid resetting budget at the same time
|
) # random interval, so multiple workers avoid resetting budget at the same time
|
||||||
|
|
|
@ -1817,6 +1817,7 @@ async def reset_budget(prisma_client: PrismaClient):
|
||||||
|
|
||||||
Updates db
|
Updates db
|
||||||
"""
|
"""
|
||||||
|
verbose_proxy_logger.debug("ENTERS RESET BUDGET")
|
||||||
if prisma_client is not None:
|
if prisma_client is not None:
|
||||||
### RESET KEY BUDGET ###
|
### RESET KEY BUDGET ###
|
||||||
now = datetime.utcnow()
|
now = datetime.utcnow()
|
||||||
|
@ -1828,12 +1829,15 @@ async def reset_budget(prisma_client: PrismaClient):
|
||||||
)
|
)
|
||||||
|
|
||||||
### RESET USER BUDGET ###
|
### RESET USER BUDGET ###
|
||||||
asyncio.create_task(
|
verbose_proxy_logger.debug("STARTS RESETTING USER BUDGET")
|
||||||
prisma_client.db.litellm_usertable.update_many(
|
try:
|
||||||
|
await prisma_client.db.litellm_usertable.update_many(
|
||||||
where={"budget_reset_at": {"lt": now}},
|
where={"budget_reset_at": {"lt": now}},
|
||||||
data={"spend": 0, "budget_reset_at": 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(
|
async def update_spend(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue