[repo] Move and rename repo._clear_planning_cache
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 15 Mar 2017 08:04:58 +0100
changeset 12057 90c40f229ab0
parent 12056 f223f98e3b14
child 12058 52ce05f7e9ee
[repo] Move and rename repo._clear_planning_cache to make it clearer it's clearing the @cache of source_defs method.
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.