[ms] proper reset cache on external source
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 11 Aug 2009 17:02:50 +0200
changeset 2763 39b42e158249
parent 2762 b1bb33b37992
child 2764 55579275a091
[ms] proper reset cache on external source
server/sources/ldapuser.py
server/sources/pyrorql.py
--- a/server/sources/ldapuser.py	Tue Aug 11 12:21:45 2009 +0200
+++ b/server/sources/ldapuser.py	Tue Aug 11 17:02:50 2009 +0200
@@ -181,6 +181,7 @@
 
     def reset_caches(self):
         """method called during test to reset potential source caches"""
+        self._cache = {}
         self._query_cache = TimedCache(2*60)
 
     def init(self):
--- a/server/sources/pyrorql.py	Tue Aug 11 12:21:45 2009 +0200
+++ b/server/sources/pyrorql.py	Tue Aug 11 17:02:50 2009 +0200
@@ -127,6 +127,10 @@
         register_persistent_options(myoptions)
         self._query_cache = TimedCache(30)
 
+    def reset_caches(self):
+        """method called during test to reset potential source caches"""
+        self._query_cache = TimedCache(30)
+
     def last_update_time(self):
         pkey = u'sources.%s.latest-update-time' % self.uri
         rql = 'Any V WHERE X is CWProperty, X value V, X pkey %(k)s'