From 9ee77a95c6686b266f3ab7105c8d5be7766e6f05 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Tue, 14 Nov 2017 10:33:47 -0500 Subject: [PATCH] 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 --- awx/main/scheduler/task_manager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/awx/main/scheduler/task_manager.py b/awx/main/scheduler/task_manager.py index bc00013d9b..25c0f28a1e 100644 --- a/awx/main/scheduler/task_manager.py +++ b/awx/main/scheduler/task_manager.py @@ -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")