# HG changeset patch # User Milka Kuzminski # Date 2020-12-25 12:49:43 # Node ID 8e2d8909200b69c11e31acb5fe9607b8747550dd # Parent 7d4e625fbe25d6deeb3cf47fc9bbb0e00e97ad92 # Parent 413758e739695dadcf39f889677809efb755dc81 release: merge back stable branch into default diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -69,3 +69,6 @@ 1485aa75ffe1b1ec48352dce7b7492d92f85e95f 5b740274011766ef2f73803cc196d081e1e7f1d4 v4.20.1 5a7835234e2c45e8fb8184c60f548a64b5842af8 v4.21.0 26af88343015f8b89d5a66f92bc7547c51fcf0df v4.22.0 +cf54e5f700fe5dc50af1a1bdf5197c18cf52105f v4.23.0 +179d989bcfe02c6227f9f6aa9236cbbe1c14c400 v4.23.1 +383aee8b1652affaa26aefe336a89ee366b2b26d v4.23.2 diff --git a/vcsserver/lib/rc_cache/__init__.py b/vcsserver/lib/rc_cache/__init__.py --- a/vcsserver/lib/rc_cache/__init__.py +++ b/vcsserver/lib/rc_cache/__init__.py @@ -52,23 +52,25 @@ def configure_dogpile_cache(settings): avail_regions = set() for key in rc_cache_data.keys(): namespace_name = key.split('.', 1)[0] - avail_regions.add(namespace_name) - log.debug('dogpile: found following cache regions: %s', avail_regions) + if namespace_name in avail_regions: + continue - # register them into namespace - for region_name in avail_regions: + avail_regions.add(namespace_name) + log.debug('dogpile: found following cache regions: %s', namespace_name) + new_region = make_region( - name=region_name, + name=namespace_name, function_key_generator=None ) - new_region.configure_from_config(settings, 'rc_cache.{}.'.format(region_name)) + new_region.configure_from_config(settings, 'rc_cache.{}.'.format(namespace_name)) new_region.function_key_generator = backend_key_generator(new_region.actual_backend) if log.isEnabledFor(logging.DEBUG): region_args = dict(backend=new_region.actual_backend.__class__, region_invalidator=new_region.region_invalidator.__class__) - log.debug('dogpile: registering a new region `%s` %s', region_name, region_args) - region_meta.dogpile_cache_regions[region_name] = new_region + log.debug('dogpile: registering a new region `%s` %s', namespace_name, region_args) + + region_meta.dogpile_cache_regions[namespace_name] = new_region def includeme(config):