1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

Merge pull request #636 from ansible/fix_celery_inspector

Delay instantiation of the celery app for the inspector
This commit is contained in:
Matthew Jones 2017-11-14 10:42:10 -05:00 committed by GitHub
commit f46bacdeaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ from awx.main import tasks as awx_tasks
from awx.main.utils import decrypt_field
# Celery
from awx import celery_app
from celery import Celery
from celery.app.control import Inspect
@ -132,7 +132,9 @@ class TaskManager():
'''
def get_active_tasks(self):
if not hasattr(settings, 'IGNORE_CELERY_INSPECTOR'):
inspector = Inspect(app=celery_app)
app = Celery('awx')
app.config_from_object('django.conf:settings', namespace='CELERY')
inspector = Inspect(app=app)
active_task_queues = inspector.active()
else:
logger.warn("Ignoring celery task inspector")