From 6955710b7e5563d132fdb0d84fff7098338dc3d2 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 16 Dec 2025 23:45:31 +0300 Subject: [PATCH] feat: timeouts on tasks --- background/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/background/tasks.py b/background/tasks.py index 28c827a..ad08759 100644 --- a/background/tasks.py +++ b/background/tasks.py @@ -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():