From e1614b53240beed7512c3ae366935237fdf7b411 Mon Sep 17 00:00:00 2001 From: Raul Gallegos Date: Mon, 8 Mar 2021 12:34:51 -0500 Subject: [PATCH] fix: revert back the bundle_draft_files cache key (#26897) Changes the LMS/Studio bundle cache key, thus invalidating all 47hr-TTL entries in favor of new 50min-TTL entries. TNL-7771 --- openedx/core/djangolib/blockstore_cache.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openedx/core/djangolib/blockstore_cache.py b/openedx/core/djangolib/blockstore_cache.py index df1e3fdf32..6284983ea9 100644 --- a/openedx/core/djangolib/blockstore_cache.py +++ b/openedx/core/djangolib/blockstore_cache.py @@ -147,7 +147,7 @@ def get_bundle_version_number(bundle_uuid, draft_name=None): # Cache the draft files using the version. This saves an API call when the draft is first retrieved. draft_files = list(draft_metadata.files.values()) draft_files_cache_key = _construct_versioned_cache_key( - bundle_uuid, version, ('bundle_draft_files_v2', ), draft_name) + bundle_uuid, version, ('bundle_draft_files', ), draft_name) cache.set(draft_files_cache_key, draft_files) # If we're not using a draft or the draft does not exist [anymore], fall # back to the bundle version, if any versions have been published: @@ -183,8 +183,7 @@ def get_bundle_draft_files_cached(bundle_uuid, draft_name): """ bundle_cache = BundleCache(bundle_uuid, draft_name) - # This key is `_v2` to avoid reading invalid values cached by a past version of this code with no timeout. - cache_key = ('bundle_draft_files_v2', ) + cache_key = ('bundle_draft_files', ) result = bundle_cache.get(cache_key) if result is None: result = list(blockstore_api.get_bundle_files(bundle_uuid, use_draft=draft_name))