mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 02:17:37 -02:30
Load Celery inspector manually when needed
This commit is contained in:
@@ -9,7 +9,7 @@ import logging
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
# Celery
|
# Celery
|
||||||
from celery import current_app
|
from celery import Celery
|
||||||
|
|
||||||
logger = logging.getLogger('awx.main.utils.reload')
|
logger = logging.getLogger('awx.main.utils.reload')
|
||||||
|
|
||||||
@@ -23,8 +23,10 @@ def _uwsgi_fifo_command(uwsgi_command):
|
|||||||
|
|
||||||
|
|
||||||
def _reset_celery_thread_pool():
|
def _reset_celery_thread_pool():
|
||||||
# Send signal to restart thread pool
|
# Do not use current_app because of this outstanding issue:
|
||||||
app = current_app._get_current_object()
|
# 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},
|
app.control.broadcast('pool_restart', arguments={'reload': True},
|
||||||
destination=['celery@{}'.format(settings.CLUSTER_HOST_ID)], reply=False)
|
destination=['celery@{}'.format(settings.CLUSTER_HOST_ID)], reply=False)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user