mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-03 21:31:56 -05:00
New awx.main.utils directory, distributed task to invalidate settings
This commit is contained in:
@@ -42,6 +42,8 @@ from django.utils.encoding import smart_str
|
||||
from django.core.mail import send_mail
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.core.cache import cache
|
||||
from django.utils.log import configure_logging
|
||||
|
||||
# AWX
|
||||
from awx.main.constants import CLOUD_PROVIDERS
|
||||
@@ -83,6 +85,17 @@ def celery_startup(conf=None, **kwargs):
|
||||
logger.error("Failed to rebuild schedule {}: {}".format(sch, e))
|
||||
|
||||
|
||||
@task(queue='broadcast_all')
|
||||
def clear_cache_keys(cache_keys):
|
||||
set_of_keys = set([key for key in cache_keys])
|
||||
logger.debug('cache delete_many(%r)', set_of_keys)
|
||||
cache.delete_many(set_of_keys)
|
||||
for setting_key in set_of_keys:
|
||||
if setting_key.startswith('LOG_AGGREGATOR_'):
|
||||
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
|
||||
break
|
||||
|
||||
|
||||
@task(queue='default')
|
||||
def send_notifications(notification_list, job_id=None):
|
||||
if not isinstance(notification_list, list):
|
||||
|
||||
Reference in New Issue
Block a user