[Erp5-report] r17831 - /erp5/trunk/products/ERP5Type/Cache.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Nov 27 17:53:52 CET 2007


Author: jerome
Date: Tue Nov 27 17:53:51 2007
New Revision: 17831

URL: http://svn.erp5.org?rev=17831&view=rev
Log:
use .value instead of .getValue(), because this part have to be really fast


Modified:
    erp5/trunk/products/ERP5Type/Cache.py

Modified: erp5/trunk/products/ERP5Type/Cache.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Cache.py?rev=17831&r1=17830&r2=17831&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Cache.py (original)
+++ erp5/trunk/products/ERP5Type/Cache.py Tue Nov 27 17:53:51 2007
@@ -85,26 +85,25 @@
     """ When CacheFactory is called it will try to return cached value using
     appropriate cache plugin.
     """
-    cache_duration = self.cache_duration
-
     ## Expired Cache (if needed)
     self.expire()
 
     quick_cached = self.quick_cache.get(cache_id, scope)
     if quick_cached is not None:
-      return quick_cached.getValue()
+      return quick_cached.value
     else:
       ## not in local, check if it's in shared
       for shared_cache in self.shared_caches:
         if shared_cache.has_key(cache_id, scope):
           cache_entry = shared_cache.get(cache_id, scope)
-          value = cache_entry.getValue()
+          value = cache_entry.value
           ## update local cache
           self.quick_cache.set(cache_id, scope, value,
                               cache_entry.cache_duration,
                               cache_entry.calculation_time)
           return value
 
+    cache_duration = self.cache_duration
     ## not in any available cache plugins calculate and set to local ..
     start = time()
     value = callable_object(*args, **kwd)




More information about the Erp5-report mailing list