handling celery tasks without any arguments

This commit is contained in:
Hossein Shafagh 2019-08-13 11:42:43 -07:00
parent 07a9c56fb8
commit 4d728738ee

View File

@ -65,6 +65,9 @@ celery = make_celery(flask_app)
def is_task_active(fun, task_id, args):
from celery.task.control import inspect
if not args:
args = '()' # empty args
i = inspect()
active_tasks = i.active()
for _, tasks in active_tasks.items():