Commit b400a4c4 authored by Ivan Tyagov's avatar Ivan Tyagov

Fix None condition check and set a smaller value for cache key expiration.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24637 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 527d1bf1
......@@ -91,10 +91,10 @@ class DistributedRamCache(BaseCache):
def set(self, cache_id, scope, value, cache_duration= None, calculation_time=0):
cache_storage = self.getCacheStorage()
cache_id = self.checkAndFixCacheId(cache_id, scope)
if not cache_duration:
if cache_duration is None:
## what should be default cache_duration when None is specified?
## currently when 'None' it means forever so give it big value of 100 hours
cache_duration = 360000
## currently when 'None' it means forever so give it big value of 24 hours
cache_duration = 86400
cache_entry = CacheEntry(value, cache_duration, calculation_time)
cache_storage.set(cache_id, cache_entry, cache_duration)
#self.markCacheMiss()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment