removing thread-local cache for branch_setting

This commit is contained in:
Jason Bau
2014-07-17 11:05:47 -04:00
parent ebfcb5d8ce
commit f12fa05ae1
2 changed files with 3 additions and 18 deletions

View File

@@ -135,10 +135,6 @@ class ModuleI18nService(object):
return strftime_localized(*args, **kwargs)
# thread local cache
_THREAD_CACHE = threading.local()
def _get_modulestore_branch_setting():
"""
Returns the branch setting for the module store from the current Django request if configured,
@@ -166,7 +162,6 @@ def _get_modulestore_branch_setting():
branch = getattr(settings, 'MODULESTORE_BRANCH', None)
return branch
# cache the branch setting for this thread so we don't have to recompute it each time
if not hasattr(_THREAD_CACHE, 'branch_setting'):
_THREAD_CACHE.branch_setting = get_branch_setting()
return _THREAD_CACHE.branch_setting
# leaving this in code structured in closure-friendly format b/c we might eventually cache this (again)
# using request_cache
return get_branch_setting()