dont overwrite key
This commit is contained in:
parent
fcb069c7de
commit
7cd5befb8a
1 changed files with 3 additions and 3 deletions
|
@ -8,10 +8,10 @@ class Cache(dict):
|
|||
|
||||
def get(self, key):
|
||||
now = time.time()
|
||||
for key, value in list(self._added.items()):
|
||||
for k, value in list(self._added.items()):
|
||||
if value < now:
|
||||
del self._added[key]
|
||||
del self[key]
|
||||
del self._added[k]
|
||||
del self[k]
|
||||
return dict.get(self, key)
|
||||
|
||||
def set(self, key, value, ttl=None):
|
||||
|
|
Loading…
Reference in a new issue