Commit 72f358fc authored by Philippe Pepiot's avatar Philippe Pepiot
Browse files

Detect celery workflow meta tasks with task.type instead of hasattr

This make code more readable and less error prone.
parent 1535d4229beb
......@@ -257,11 +257,11 @@ class CeleryTaskAdapter(ICeleryTask):
task_name=task_name,
parent_task=parent)
seen.add(task_id)
if hasattr(task, 'body'):
self.attach_task(task.body, seen, parent)
if hasattr(task, 'tasks'):
if task.name in ('celery.chord', 'celery.chain', 'celery.group'):
for subtask in task.tasks:
self.attach_task(subtask, seen, parent)
if task.name == 'celery.chord':
self.attach_task(task.body, seen, parent)
def get_task(self, name, *args, **kwargs):
task = super(CeleryTaskAdapter, self).get_task(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment