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