mirror of
https://github.com/ansible/awx.git
synced 2026-03-05 10:41:05 -03:30
Merge pull request #636 from ansible/fix_celery_inspector
Delay instantiation of the celery app for the inspector
This commit is contained in:
@@ -41,7 +41,7 @@ from awx.main import tasks as awx_tasks
|
|||||||
from awx.main.utils import decrypt_field
|
from awx.main.utils import decrypt_field
|
||||||
|
|
||||||
# Celery
|
# Celery
|
||||||
from awx import celery_app
|
from celery import Celery
|
||||||
from celery.app.control import Inspect
|
from celery.app.control import Inspect
|
||||||
|
|
||||||
|
|
||||||
@@ -132,7 +132,9 @@ class TaskManager():
|
|||||||
'''
|
'''
|
||||||
def get_active_tasks(self):
|
def get_active_tasks(self):
|
||||||
if not hasattr(settings, 'IGNORE_CELERY_INSPECTOR'):
|
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()
|
active_task_queues = inspector.active()
|
||||||
else:
|
else:
|
||||||
logger.warn("Ignoring celery task inspector")
|
logger.warn("Ignoring celery task inspector")
|
||||||
|
|||||||
Reference in New Issue
Block a user