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:
commit
f46bacdeaa
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user