##// END OF EJS Templates
caches: sync code from CE for faster load of cache engines.
marcink -
r904:970a6093 stable
parent child Browse files
Show More
@@ -52,23 +52,25 b' def configure_dogpile_cache(settings):'
52 52 avail_regions = set()
53 53 for key in rc_cache_data.keys():
54 54 namespace_name = key.split('.', 1)[0]
55 avail_regions.add(namespace_name)
56 log.debug('dogpile: found following cache regions: %s', avail_regions)
55 if namespace_name in avail_regions:
56 continue
57 57
58 # register them into namespace
59 for region_name in avail_regions:
58 avail_regions.add(namespace_name)
59 log.debug('dogpile: found following cache regions: %s', namespace_name)
60
60 61 new_region = make_region(
61 name=region_name,
62 name=namespace_name,
62 63 function_key_generator=None
63 64 )
64 65
65 new_region.configure_from_config(settings, 'rc_cache.{}.'.format(region_name))
66 new_region.configure_from_config(settings, 'rc_cache.{}.'.format(namespace_name))
66 67 new_region.function_key_generator = backend_key_generator(new_region.actual_backend)
67 68 if log.isEnabledFor(logging.DEBUG):
68 69 region_args = dict(backend=new_region.actual_backend.__class__,
69 70 region_invalidator=new_region.region_invalidator.__class__)
70 log.debug('dogpile: registering a new region `%s` %s', region_name, region_args)
71 region_meta.dogpile_cache_regions[region_name] = new_region
71 log.debug('dogpile: registering a new region `%s` %s', namespace_name, region_args)
72
73 region_meta.dogpile_cache_regions[namespace_name] = new_region
72 74
73 75
74 76 def includeme(config):
General Comments 0
You need to be logged in to leave comments. Login now