mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Fix check if the item doesn't exist in the ttl cache
This commit is contained in:
parent
c4bb78a3fe
commit
4f07cd9b82
@ -15,6 +15,8 @@ class CacheDict(dict):
|
||||
'''
|
||||
Enforce the TTL to a specific key, delete if its past TTL
|
||||
'''
|
||||
if key not in self._key_cache_time:
|
||||
return
|
||||
if time.time() - self._key_cache_time[key] > self._ttl:
|
||||
del self._key_cache_time[key]
|
||||
dict.__delitem__(self, key)
|
||||
|
Loading…
Reference in New Issue
Block a user