avoid concurrent key removal error
This commit is contained in:
parent
b50821ba85
commit
e531419364
1 changed files with 2 additions and 2 deletions
|
@ -10,8 +10,8 @@ class Cache(dict):
|
|||
now = time.time()
|
||||
for k, value in list(self._added.items()):
|
||||
if value < now:
|
||||
del self._added[k]
|
||||
del self[k]
|
||||
self._added.pop(k, None)
|
||||
self.pop(k, None)
|
||||
return dict.get(self, key)
|
||||
|
||||
def set(self, key, value, ttl=None):
|
||||
|
|
Loading…
Reference in a new issue