# HG changeset patch # User Sylvain Thénault # Date 1489561498 -3600 # Node ID 90c40f229ab02c0955a34cb0666fd0f7e5b3f18d # Parent f223f98e3b1401fb8f76384b22e94681d57cb870 [repo] Move and rename repo._clear_planning_cache to make it clearer it's clearing the @cache of source_defs method. diff -r f223f98e3b14 -r 90c40f229ab0 cubicweb/server/repository.py --- a/cubicweb/server/repository.py Fri Mar 10 10:10:44 2017 +0100 +++ b/cubicweb/server/repository.py Wed Mar 15 08:04:58 2017 +0100 @@ -322,9 +322,6 @@ continue self.add_source(sourceent) - def _clear_planning_caches(self): - clear_cache(self, 'source_defs') - def add_source(self, sourceent): try: source = self.get_source(sourceent.type, sourceent.name, @@ -344,12 +341,12 @@ source.init(True, sourceent) else: source.init(False, sourceent) - self._clear_planning_caches() + self._clear_source_defs_caches() def remove_source(self, uri): source = self.sources_by_uri.pop(uri) del self.sources_by_eid[source.eid] - self._clear_planning_caches() + self._clear_source_defs_caches() def get_source(self, type, uri, source_config, eid=None): # set uri and type in source config so it's available through @@ -590,6 +587,9 @@ sources[uri] = source.public_config return sources + def _clear_source_defs_caches(self): + clear_cache(self, 'source_defs') + def properties(self): """Return a result set containing system wide properties.