Load Celery inspector manually when needed

This commit is contained in:
Wayne Witzel III 2018-01-29 14:55:01 +00:00
parent 87365e5969
commit 55a616cba6

View File

@ -9,7 +9,7 @@ import logging
from django.conf import settings
# Celery
from celery import current_app
from celery import Celery
logger = logging.getLogger('awx.main.utils.reload')
@ -23,8 +23,10 @@ def _uwsgi_fifo_command(uwsgi_command):
def _reset_celery_thread_pool():
# Send signal to restart thread pool
app = current_app._get_current_object()
# Do not use current_app because of this outstanding issue:
# https://github.com/celery/celery/issues/4410
app = Celery('awx')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.control.broadcast('pool_restart', arguments={'reload': True},
destination=['celery@{}'.format(settings.CLUSTER_HOST_ID)], reply=False)