From 28242afac822028daf990eeb3698f2bca05bf513 Mon Sep 17 00:00:00 2001 From: Anatoly Bogomolov Date: Fri, 12 Apr 2024 21:43:08 +1000 Subject: [PATCH] run syc or async --- app/blueprints/api/tasks/routes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/blueprints/api/tasks/routes.py b/app/blueprints/api/tasks/routes.py index 4f18d63..8ac94d0 100644 --- a/app/blueprints/api/tasks/routes.py +++ b/app/blueprints/api/tasks/routes.py @@ -100,7 +100,10 @@ def start_task(task_id: int): add_to_group_task.delay(task_id=task_id) case 'parse': - parse_users_task.delay(task_id=task_id) + if task.file: + parse_users_task.delay(task_id=task_id) + else: + parse_users_task.run(task_id=task_id) return '', 204