From 63b5f8305d6e7e363f7c30a1293546b2e80abc77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 25 May 2010 15:34:39 +0200 Subject: [PATCH] append time to ldap cache key --- PcfAnnuaire.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PcfAnnuaire.py b/PcfAnnuaire.py index 3f2bca9..701a7f3 100644 --- a/PcfAnnuaire.py +++ b/PcfAnnuaire.py @@ -52,7 +52,10 @@ class PcfAnnuaireService: pass def cache_key(method, self): - return hash(self) + # append time, so old entries do not get returned forever; (they will still + # get removed as stale entries are automatically removed after 3 days) + # (cf plone/memoize/volatile.py) + return hash(self) + repr(int(time.time()) / 300) class PcfAnnuaire(BaseContent):