[CWCache] fix CWCache validity test stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 10 Jun 2009 21:02:21 +0200
branchstable
changeset 2098 13aab3775af7
parent 2097 400bdbcc5699
child 2099 0cba78f4fa12
[CWCache] fix CWCache validity test
appobject.py
entities/lib.py
--- a/appobject.py	Wed Jun 10 21:01:49 2009 +0200
+++ b/appobject.py	Wed Jun 10 21:02:21 2009 +0200
@@ -127,8 +127,7 @@
         if cachename in CACHE_REGISTRY:
             cache = CACHE_REGISTRY[cachename]
         else:
-            cache = Cache()
-            CACHE_REGISTRY[cachename] = cache
+            cache = CACHE_REGISTRY[cachename] = Cache()
         _now = datetime.now()
         if _now > cache.latest_cache_lookup + ONESECOND:
             ecache = self.req.execute('Any C,T WHERE C is CWCache, C name %(name)s, C timestamp T',
--- a/entities/lib.py	Wed Jun 10 21:01:49 2009 +0200
+++ b/entities/lib.py	Wed Jun 10 21:02:21 2009 +0200
@@ -142,6 +142,6 @@
 
     def valid(self, date):
         if date:
-            return date < self.timestamp
+            return date > self.timestamp
         return False