Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
celerytask
Commits
c19d0234c332
Commit
72f358fc
authored
Jan 30, 2019
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb_celerytask/entities.py
View file @
c19d0234
...
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment