check for expired time caches in every interaction
This commit is contained in:
1 parent
0617909e84
commit
2610c180c0
1 file changed
+6
-1
+6
-1
@@ -18,7 +18,12 @@ def clear_caches():
|
|||||||
for m in memoize_caches:
|
for m in memoize_caches:
|
||||||
m.clear()
|
m.clear()
|
||||||
|
|
||||||
time_caches = []
|
for tc in time_caches:
|
||||||
|
# check time_cache for expired entries
|
||||||
|
for key, (t, value) in list(tc.items()):
|
||||||
|
if t < time.time():
|
||||||
|
# delete expired entries
|
||||||
|
del tc[key]
|
||||||
|
|
||||||
|
|
||||||
def memoize_default(default=None, cache=memoize_caches):
|
def memoize_default(default=None, cache=memoize_caches):
|
||||||
|
|||||||
Reference in new issue
Block a user