[Erp5-report] r29456 - /erp5/trunk/products/ERP5Type/CachePlugins/DistributedRamCache.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Oct 7 17:44:56 CEST 2009


Author: nicolas
Date: Wed Oct  7 17:44:56 2009
New Revision: 29456

URL: http://svn.erp5.org?rev=29456&view=rev
Log:
Delete cached_value if expired

Modified:
    erp5/trunk/products/ERP5Type/CachePlugins/DistributedRamCache.py

Modified: erp5/trunk/products/ERP5Type/CachePlugins/DistributedRamCache.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/CachePlugins/DistributedRamCache.py?rev=29456&r1=29455&r2=29456&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/CachePlugins/DistributedRamCache.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/CachePlugins/DistributedRamCache.py [utf8] Wed Oct  7 17:44:56 2009
@@ -141,10 +141,13 @@
     cache_storage = self.getCacheStorage()
     cache_id = self.checkAndFixCacheId(cache_id, scope)
     cache_entry = cache_storage.get(cache_id)
-    if isinstance(cache_entry, CacheEntry) and not cache_entry.isExpired():
-      return True
-    else:
-      return False
+    to_return = False
+    if isinstance(cache_entry, CacheEntry):
+      if cache_entry.isExpired():
+        del cache_storage[cache_id]
+      else:
+        to_return = True
+    return to_return
 
   def getScopeList(self):
     ## memcached doesn't support namespaces (cache scopes) neither getting cached key list 




More information about the Erp5-report mailing list