reload settings on fork or new thread

* Reloading settings will re-import cache. Django cache is thread aware,
but keeping an old reference to the cache avoids the awareness.
This commit is contained in:
Chris Meyers
2021-06-24 16:00:17 -04:00
parent c09cad3e6d
commit 84116349ab

View File

@@ -1086,8 +1086,11 @@ def cleanup_new_process(func):
@wraps(func)
def wrapper_cleanup_new_process(*args, **kwargs):
from awx.conf.settings import SettingsWrapper # noqa
django_connection.close()
django_cache.close()
SettingsWrapper.initialize()
return func(*args, **kwargs)
return wrapper_cleanup_new_process