Skip to content

Commit 50424c1

Browse files
authored
Merge pull request #374 from leo-naeka/master
Respect celery 4+ configuration names
2 parents bc2d4ee + 1fc54c4 commit 50424c1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

health_check/contrib/celery_ping/backends.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ def _check_ping_result(self, ping_result):
5050
self._check_active_queues(active_workers)
5151

5252
def _check_active_queues(self, active_workers):
53-
defined_queues = app.conf.CELERY_QUEUES
53+
try:
54+
# Celery 4+
55+
defined_queues = app.conf.task_queues
56+
except AttributeError:
57+
# Celery <4
58+
defined_queues = app.conf.CELERY_QUEUES
5459

5560
if not defined_queues:
5661
return

0 commit comments

Comments
 (0)