feat: timeouts on tasks

This commit is contained in:
2025-12-16 23:45:31 +03:00
parent 86a376ceb2
commit 6955710b7e

View File

@@ -12,7 +12,7 @@ from database import Marketplace, Company
from utils import chunk_list
SMALL_TIMEOUT = 100
LARGE_TIMEOUT = 500
LARGE_TIMEOUT = 15 * 60
@taskiq_broker.task(task_name='process_update', timeout=SMALL_TIMEOUT)
@@ -62,7 +62,7 @@ async def flush_buffer():
logging.error(f'Error in flush_buffer: {e}')
@taskiq_broker.task(schedule=[{"cron": "0 */3 * * *"}], timeout=LARGE_TIMEOUT)
@taskiq_broker.task(schedule=[{"cron": "*/15 * * * *"}], timeout=LARGE_TIMEOUT)
async def reset_companies_with_zero_balance():
logging.info(f'Flushing zero balance companies')
async for session in get_session():