Merge pull request #1828 from matrix-org/erikj/iterable_cache_size

Update LruCache size estimate on clear
This commit is contained in:
Erik Johnston 2017-01-18 14:57:54 +00:00 committed by GitHub
commit 841c228533
1 changed files with 2 additions and 0 deletions

View File

@ -189,6 +189,8 @@ class LruCache(object):
for cb in node.callbacks: for cb in node.callbacks:
cb() cb()
cache.clear() cache.clear()
if size_callback:
cached_cache_len[0] = 0
@synchronized @synchronized
def cache_contains(key): def cache_contains(key):