mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
Delay instantiation of the celery app for the inspector
This keeps the instance from re-using a pool that might have already expired and is unusable for the inspector that needs to run as part of the task manager
This commit is contained in:
parent
93b80307db
commit
9ee77a95c6
@ -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