test(test_keys.py): add more retries for checking if budget updated

This commit is contained in:
Krrish Dholakia 2024-01-31 10:44:03 -08:00
parent cf5f6ab49c
commit eea4325e60
2 changed files with 15 additions and 4 deletions

View file

@ -1743,7 +1743,10 @@ async def startup_event():
### START BUDGET SCHEDULER ###
scheduler = AsyncIOScheduler()
scheduler.add_job(reset_budget, "interval", seconds=10, args=[prisma_client])
interval = random.randint(
7, 14
) # random interval, so multiple workers avoid resetting budget at the same time
scheduler.add_job(reset_budget, "interval", seconds=interval, args=[prisma_client])
scheduler.start()