feat: timeouts on tasks
This commit is contained in:
@@ -12,7 +12,7 @@ from database import Marketplace, Company
|
|||||||
from utils import chunk_list
|
from utils import chunk_list
|
||||||
|
|
||||||
SMALL_TIMEOUT = 100
|
SMALL_TIMEOUT = 100
|
||||||
LARGE_TIMEOUT = 15 * 60
|
LARGE_TIMEOUT = 30 * 60
|
||||||
|
|
||||||
|
|
||||||
@taskiq_broker.task(task_name='process_update', timeout=SMALL_TIMEOUT)
|
@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}')
|
logging.error(f'Error in flush_buffer: {e}')
|
||||||
|
|
||||||
|
|
||||||
@taskiq_broker.task(schedule=[{"cron": "*/15 * * * *"}], timeout=LARGE_TIMEOUT)
|
@taskiq_broker.task(schedule=[{"cron": "*/30 * * * *"}], timeout=LARGE_TIMEOUT)
|
||||||
async def reset_companies_with_zero_balance():
|
async def reset_companies_with_zero_balance():
|
||||||
logging.info(f'Flushing zero balance companies')
|
logging.info(f'Flushing zero balance companies')
|
||||||
async for session in get_session():
|
async for session in get_session():
|
||||||
|
|||||||
Reference in New Issue
Block a user