Merge pull request #10537 from chrismeyersfsu/fix-fork

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.

The performance team that was hitting this every time before. With this change they are unable to recreated.

Reviewed-by: Shane McDonald <me@shanemcd.com>
This commit is contained in:
softwarefactory-project-zuul[bot] 2021-06-29 12:53:30 +00:00 committed by GitHub
commit 747231d350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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