| Total Complexity | 5 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from dogpile.cache import make_region |
||
| 2 | |||
| 3 | tree_region = make_region() |
||
| 4 | list_region = make_region() |
||
| 5 | |||
| 6 | |||
| 7 | def includeme(config): # pragma: no cover |
||
| 8 | """Configure caching regions from settings.""" |
||
| 9 | settings = config.registry.settings |
||
| 10 | if not tree_region.is_configured: |
||
| 11 | tree_region.configure_from_config(settings, 'cache.tree.') |
||
| 12 | if not list_region.is_configured: |
||
| 13 | list_region.configure_from_config(settings, 'cache.list.') |
||
| 14 | |||
| 15 | |||
| 16 | def invalidate_scheme_cache(conceptscheme_id): |
||
| 17 | # TODO implement propper conceptscheme cache invalidation if this is ever possible |
||
| 18 | tree_region.invalidate() |
||
| 19 | |||
| 20 | |||
| 21 | def invalidate_cache(): |
||
| 22 | tree_region.invalidate() |
||
| 23 |