--- a/server/sources/__init__.py Wed Jun 02 16:25:12 2010 +0000
+++ b/server/sources/__init__.py Wed Jun 02 17:23:42 2010 +0000
@@ -52,11 +52,11 @@
return True
class TimedCache(dict):
- def __init__(self, ttlm, ttls=0):
- # time to live in minutes
- self.ttl = timedelta(seconds=ttlm*60 + ttls)
- if self.ttl.seconds <= 0:
+ def __init__(self, ttl):
+ # time to live in seconds
+ if ttl <= 0:
raise ValueError('TimedCache initialized with a ttl of %ss' % self.ttl.seconds)
+ self.ttl = timedelta(seconds=ttl)
def __setitem__(self, key, value):
dict.__setitem__(self, key, (datetime.now(), value))