Commit 23fd1993 authored by Aurelien Lubert's avatar Aurelien Lubert
Browse files

feat(celery): Update to Celery 5

parent 32946ea6cfcf
Pipeline #138178 failed with stages
in 2 minutes and 9 seconds
......@@ -15,8 +15,8 @@ description = 'Run and monitor celery tasks'
web = 'https://forge.extranet.logilab.fr/cubicweb/cubes/%s' % distname
__depends__ = {
'celery': '~= 5.0',
'cubicweb': ">= 3.26.18, < 3.38.0",
'celery': '>=4,<5',
'cw-celerytask-helpers': '>= 0.11.0',
}
__recommends__ = {}
......
......@@ -196,7 +196,7 @@ class ICeleryTask(EntityAdapter):
raise NotImplementedError
def revoke(self, terminate=True, signal='SIGKILL'):
return celery.task.control.revoke(
return celery.current_app.control.revoke(
[self.task_id], terminate=terminate, signal=signal)
@property
......@@ -281,7 +281,7 @@ class CeleryTaskAdapter(ICeleryTask):
def revoke(self, terminate=True, signal='SIGKILL'):
to_revoke = set([e.task_id for e in self.entity.child_tasks()])
return celery.task.control.revoke(
return celery.current_app.control.revoke(
list(to_revoke), terminate=terminate, signal=signal)
def attach_result(self, result):
......
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