Initial commit to support Celery 4.3.0

Merges 55e9b2263c from versions/next
with code from GitLab issue #594 and GitLab merge request !55.

Thanks to Jakob Haufe (@sur5r) and Jesaja Everling (@jeverling)
for much of the research and code updates.

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-07-17 04:30:11 -04:00
parent 0b42567179
commit ab601f9180
23 changed files with 119 additions and 79 deletions

View File

@@ -156,13 +156,13 @@ class CeleryQueue(object):
if self.transient:
kwargs['delivery_mode'] = 1
celery_app.conf.CELERY_QUEUES.append(Queue(**kwargs))
celery_app.conf.task_queues.append(Queue(**kwargs))
if self.default_queue:
celery_app.conf.CELERY_DEFAULT_QUEUE = self.name
celery_app.conf.task_default_queue = self.name
for task_type in self.task_types:
celery_app.conf.CELERY_ROUTES.update(
celery_app.conf.task_routes.update(
{
task_type.dotted_path: {
'queue': self.name
@@ -171,7 +171,7 @@ class CeleryQueue(object):
)
if task_type.schedule:
celery_app.conf.CELERYBEAT_SCHEDULE.update(
celery_app.conf.beat_schedule.update(
{
task_type.name: {
'task': task_type.dotted_path,