From bbad963f1b9c3cae478a75bb99abe13f9aeda9c6 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 26 Oct 2009 18:20:05 +0530 Subject: [PATCH] [FIX] Config : wrong calculation if cached_timeout comes from config file bzr revid: jvo@tinyerp.com-20091026125005-r8jbk8iqhpessa2c --- bin/tools/misc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/tools/misc.py b/bin/tools/misc.py index d8bd58bfcbd..ca93a3936e2 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -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]