diff --git a/allianceauth/project_template/project_name/__init__.py b/allianceauth/project_template/project_name/__init__.py index e69de29b..cf2e85f6 100644 --- a/allianceauth/project_template/project_name/__init__.py +++ b/allianceauth/project_template/project_name/__init__.py @@ -0,0 +1 @@ +from .celery import app as celery_app diff --git a/allianceauth/templatetags/admin_status.py b/allianceauth/templatetags/admin_status.py index caad3ad6..f9886ab5 100644 --- a/allianceauth/templatetags/admin_status.py +++ b/allianceauth/templatetags/admin_status.py @@ -1,5 +1,6 @@ import requests import logging +import amqp.exceptions import semantic_version as semver from django import template from django.conf import settings @@ -54,6 +55,9 @@ def get_celery_queue_length(): with app.connection_or_acquire() as conn: return conn.default_channel.queue_declare( queue=getattr(settings, 'CELERY_DEFAULT_QUEUE', 'celery'), passive=True).message_count + except amqp.exceptions.ChannelError: + # Queue doesn't exist, probably empty + return 0 except Exception: logger.exception("Failed to get celery queue length") return -1