From 84d535414c0e4fd905311a42d4ccba0edfcf7314 Mon Sep 17 00:00:00 2001 From: Nicolas Delaby <nicolas@nexedi.com> Date: Fri, 16 Oct 2009 11:43:35 +0000 Subject: [PATCH] revert r29692; 0 means no expiration git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29753 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/CachePlugins/BaseCache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product/ERP5Type/CachePlugins/BaseCache.py b/product/ERP5Type/CachePlugins/BaseCache.py index 68807b02c8..c989d65728 100644 --- a/product/ERP5Type/CachePlugins/BaseCache.py +++ b/product/ERP5Type/CachePlugins/BaseCache.py @@ -49,7 +49,7 @@ class CacheEntry(object): def __init__(self, value, cache_duration=None, calculation_time=0): self.value = value if cache_duration in (None, 0): - self.expires_at = None + self.expires_at = cache_duration else: self.expires_at = time() + cache_duration self._cache_hit_count = 0 @@ -60,7 +60,7 @@ class CacheEntry(object): - None means allways expire - 0 means never expire """ - return self.expires_at is None or self.expires_at < time() + return self.expires_at is None or self.expires_at != 0 and self.expires_at < time() def markCacheHit(self, delta=1): """ mark a read to this cache entry """ -- 2.30.9