# HG changeset patch # User RhodeCode Admin # Date 2024-10-22 10:12:52 # Node ID 102bd5387d37aacf0e6ff21ed49ddc891add268a # Parent b7348fbb7ccf9d757189501653c6819571f0246e caches: allow force re-init of cache region for re-creating the cache diff --git a/rhodecode/lib/rc_cache/utils.py b/rhodecode/lib/rc_cache/utils.py --- a/rhodecode/lib/rc_cache/utils.py +++ b/rhodecode/lib/rc_cache/utils.py @@ -174,7 +174,7 @@ def backend_key_generator(backend): return wrapper -def get_or_create_region(region_name, region_namespace: str = None, use_async_runner=False): +def get_or_create_region(region_name, region_namespace: str = None, use_async_runner=False, force=False): from .backends import FileNamespaceBackend from . import async_creation_runner @@ -191,7 +191,7 @@ def get_or_create_region(region_name, re raise ValueError(f'{FileNamespaceBackend} used requires to specify region_namespace param') region_exist = region_meta.dogpile_cache_regions.get(region_namespace) - if region_exist: + if region_exist and not force: log.debug('Using already configured region: %s', region_namespace) return region_exist