mirror of
https://github.com/ansible/awx.git
synced 2024-10-27 09:25:10 +03:00
uwsgi auto-reload on logging change
This commit is contained in:
parent
24c208e243
commit
5ff62c97b6
2
Makefile
2
Makefile
@ -406,7 +406,7 @@ uwsgi: collectstatic
|
||||
@if [ "$(VENV_BASE)" ]; then \
|
||||
. $(VENV_BASE)/tower/bin/activate; \
|
||||
fi; \
|
||||
uwsgi -b 32768 --socket :8050 --module=awx.wsgi:application --home=/venv/tower --chdir=/tower_devel/ --vacuum --processes=5 --harakiri=60 --master --no-orphans --py-autoreload 1 --max-requests=1000 --stats /tmp/stats.socket
|
||||
uwsgi -b 32768 --socket :8050 --module=awx.wsgi:application --home=/venv/tower --chdir=/tower_devel/ --vacuum --processes=5 --harakiri=60 --master --no-orphans --py-autoreload 1 --max-requests=1000 --stats /tmp/stats.socket --master-fifo=/tmp/awxfifo
|
||||
|
||||
daphne:
|
||||
@if [ "$(VENV_BASE)" ]; then \
|
||||
|
@ -85,6 +85,10 @@ def celery_startup(conf=None, **kwargs):
|
||||
logger.error("Failed to rebuild schedule {}: {}".format(sch, e))
|
||||
|
||||
|
||||
def uwsgi_reload():
|
||||
os.system("echo r > /tmp/awxfifo")
|
||||
|
||||
|
||||
@task(queue='broadcast_all')
|
||||
def clear_cache_keys(cache_keys):
|
||||
set_of_keys = set([key for key in cache_keys])
|
||||
@ -92,12 +96,7 @@ def clear_cache_keys(cache_keys):
|
||||
cache.delete_many(set_of_keys)
|
||||
for setting_key in set_of_keys:
|
||||
if setting_key.startswith('LOG_AGGREGATOR_'):
|
||||
LOGGING = settings.LOGGING
|
||||
if settings.LOG_AGGREGATOR_ENABLED:
|
||||
LOGGING['handlers']['http_receiver']['class'] = 'awx.main.utils.handlers.HTTPSHandler'
|
||||
else:
|
||||
LOGGING['handlers']['http_receiver']['class'] = 'awx.main.utils.handlers.HTTPSNullHandler'
|
||||
configure_logging(settings.LOGGING_CONFIG, LOGGING)
|
||||
uwsgi_reload()
|
||||
break
|
||||
|
||||
|
||||
|
@ -999,7 +999,7 @@ LOGGING = {
|
||||
'propagate': False,
|
||||
},
|
||||
'awx.analytics': {
|
||||
'handlers': ['null'],
|
||||
'handlers': ['http_receiver'],
|
||||
'level': 'INFO',
|
||||
'propagate': False
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user