[FIX] Config : wrong calculation if cached_timeout comes from config file

bzr revid: jvo@tinyerp.com-20091026125005-r8jbk8iqhpessa2c
This commit is contained in:
Jay (Open ERP) 2009-10-26 18:20:05 +05:30
parent da2e99051a
commit bbad963f1b
1 changed files with 2 additions and 2 deletions

View File

@ -662,9 +662,9 @@ class cache(object):
self.fun_default_values = dict(zip(self.fun_arg_names[-len(argspec[3]):], argspec[3]))
def cached_result(self2, cr, *args, **kwargs):
if time.time()-self.timeout > self.lasttime:
if time.time()-int(self.timeout) > self.lasttime:
self.lasttime = time.time()
t = time.time()-self.timeout
t = time.time()-int(self.timeout)
old_keys = [key for key in self.cache if self.cache[key][1] < t]
for key in old_keys:
del self.cache[key]