diff -r 2604545d7dd9 -r b72a838aa109 server/sources/__init__.py --- a/server/sources/__init__.py Sat May 29 10:06:07 2010 +0000 +++ b/server/sources/__init__.py Wed Jun 02 15:55:58 2010 +0000 @@ -54,7 +54,9 @@ class TimedCache(dict): def __init__(self, ttlm, ttls=0): # time to live in minutes - self.ttl = timedelta(0, ttlm*60 + ttls, 0) + self.ttl = timedelta(seconds=ttlm*60 + ttls) + if self.ttl.seconds <= 0: + raise ValueError('TimedCache initialized with a ttl of %ss' % self.ttl.seconds) def __setitem__(self, key, value): dict.__setitem__(self, key, (datetime.now(), value))