[TNL-7771][LX-1409] sets blockstore values timeouts to avoid S3 links expiration (#25830)

This commit is contained in:
Raul Gallegos
2020-12-11 09:35:45 -05:00
committed by GitHub
parent e49e3fa566
commit 5279975483
3 changed files with 8 additions and 1 deletions

View File

@@ -2214,6 +2214,9 @@ BLOCKSTORE_API_URL = 'http://localhost:18250/api/v1/'
# in the blockstore-based XBlock runtime
XBLOCK_RUNTIME_V2_EPHEMERAL_DATA_CACHE = 'default'
# Blockstore data could contain S3 links, so this should be lower than Blockstore's AWS_QUERYSTRING_EXPIRE
BLOCKSTORE_BUNDLE_CACHE_TIMEOUT = 169200
###################### LEARNER PORTAL ################################
LEARNER_PORTAL_URL_ROOT = 'https://learner-portal-localhost:18000'

View File

@@ -4143,6 +4143,9 @@ BLOCKSTORE_API_URL = 'http://localhost:18250/api/v1/'
# in the blockstore-based XBlock runtime
XBLOCK_RUNTIME_V2_EPHEMERAL_DATA_CACHE = 'default'
# Blockstore data could contain S3 links, so this should be lower than Blockstore's AWS_QUERYSTRING_EXPIRE
BLOCKSTORE_BUNDLE_CACHE_TIMEOUT = 169200
######################### MICROSITE ###############################
MICROSITE_ROOT_DIR = '/edx/app/edxapp/edx-microsite'
MICROSITE_CONFIGURATION = {}

View File

@@ -12,6 +12,7 @@ and won't find the now-invalid cached data.
from datetime import datetime
from uuid import UUID
from django.conf import settings
from django.core.cache import caches, InvalidCacheBackendError
from pytz import UTC
import requests
@@ -81,7 +82,7 @@ class BundleCache(object):
"""
assert isinstance(key_parts, (list, tuple))
full_key = _get_versioned_cache_key(self.bundle_uuid, self.draft_name, key_parts)
return cache.set(full_key, value, timeout=None)
return cache.set(full_key, value, timeout=settings.BLOCKSTORE_BUNDLE_CACHE_TIMEOUT)
def clear(self):
"""