feat(cache): disable cache before using d_cache call to skip init of dcache on no-cached calls

This commit is contained in:
RhodeCode Admin 2024-04-26 12:06:48 +02:00
parent 85ed19f363
commit 695fc88813

View file

@ -421,7 +421,7 @@ class RepoFilesView(RepoAppView):
with ReentrantLock(d_cache, reentrant_lock_key):
# This is also a cache key
use_cached_archive = False
if archive_name_key in d_cache and not archive_cache_disable:
if not archive_cache_disable and archive_name_key in d_cache:
reader, tag = d_cache.get(archive_name_key, read=True, tag=True, retry=True)
use_cached_archive = True
log.debug('Found cached archive as key=%s tag=%s, serving archive from cache reader=%s',