diff --git a/common/lib/xmodule/xmodule/modulestore/django.py b/common/lib/xmodule/xmodule/modulestore/django.py index cd69fb1c7a..47e12b3ed4 100644 --- a/common/lib/xmodule/xmodule/modulestore/django.py +++ b/common/lib/xmodule/xmodule/modulestore/django.py @@ -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() diff --git a/lms/djangoapps/courseware/tests/test_courses.py b/lms/djangoapps/courseware/tests/test_courses.py index ee4a88c47d..cd00abc120 100644 --- a/lms/djangoapps/courseware/tests/test_courses.py +++ b/lms/djangoapps/courseware/tests/test_courses.py @@ -47,16 +47,6 @@ class CoursesTest(ModuleStoreTestCase): class ModuleStoreBranchSettingTest(ModuleStoreTestCase): """Test methods related to the modulestore branch setting.""" - def cleanup_branch_setting(self): - if hasattr(store_django._THREAD_CACHE, 'branch_setting'): - delattr(store_django._THREAD_CACHE, 'branch_setting') - - def setUp(self): - self.cleanup_branch_setting() - - def tearDown(self): - self.cleanup_branch_setting() - @mock.patch( 'xmodule.modulestore.django.get_current_request_hostname', mock.Mock(return_value='preview.localhost')