increase cache ttl to 60 seconds
This commit is contained in:
parent
8537026ef1
commit
3132cc02fe
2 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,7 @@ import time
|
|||
|
||||
class Cache(dict):
|
||||
|
||||
def __init__(self, ttl=10):
|
||||
def __init__(self, ttl=60):
|
||||
self._ttl = ttl
|
||||
self._added = {}
|
||||
|
||||
|
|
|
@ -282,7 +282,7 @@ class List(db.Model):
|
|||
id += self.user_id
|
||||
id = '%s:%s' % (id, self.id)
|
||||
return id
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
return self.public_id
|
||||
|
||||
|
@ -296,7 +296,7 @@ class List(db.Model):
|
|||
value = Parser(Item).find({'query': data}).count()
|
||||
else:
|
||||
value = len(self.items)
|
||||
state.cache.set(key, value)
|
||||
state.cache.set(key, value, ttl=90)
|
||||
return value
|
||||
|
||||
def json(self):
|
||||
|
|
Loading…
Reference in a new issue