##// END OF EJS Templates
core: speed up cache loading
milka -
r4594:46592d9a stable
parent child Browse files
Show More
@@ -62,24 +62,25 b' def configure_dogpile_cache(settings):'
62 avail_regions = set()
62 avail_regions = set()
63 for key in rc_cache_data.keys():
63 for key in rc_cache_data.keys():
64 namespace_name = key.split('.', 1)[0]
64 namespace_name = key.split('.', 1)[0]
65 avail_regions.add(namespace_name)
65 if namespace_name in avail_regions:
66 log.debug('dogpile: found following cache regions: %s', avail_regions)
66 continue
67
67
68 # register them into namespace
68 avail_regions.add(namespace_name)
69 for region_name in avail_regions:
69 log.debug('dogpile: found following cache regions: %s', namespace_name)
70
70 new_region = make_region(
71 new_region = make_region(
71 name=region_name,
72 name=namespace_name,
72 function_key_generator=None
73 function_key_generator=None
73 )
74 )
74
75
75 new_region.configure_from_config(settings, 'rc_cache.{}.'.format(region_name))
76 new_region.configure_from_config(settings, 'rc_cache.{}.'.format(namespace_name))
76 new_region.function_key_generator = backend_key_generator(new_region.actual_backend)
77 new_region.function_key_generator = backend_key_generator(new_region.actual_backend)
77 if log.isEnabledFor(logging.DEBUG):
78 if log.isEnabledFor(logging.DEBUG):
78 region_args = dict(backend=new_region.actual_backend.__class__,
79 region_args = dict(backend=new_region.actual_backend.__class__,
79 region_invalidator=new_region.region_invalidator.__class__)
80 region_invalidator=new_region.region_invalidator.__class__)
80 log.debug('dogpile: registering a new region `%s` %s', region_name, region_args)
81 log.debug('dogpile: registering a new region `%s` %s', namespace_name, region_args)
81
82
82 region_meta.dogpile_cache_regions[region_name] = new_region
83 region_meta.dogpile_cache_regions[namespace_name] = new_region
83
84
84
85
85 def includeme(config):
86 def includeme(config):
General Comments 0
You need to be logged in to leave comments. Login now