diff options
author | Erik Johnston <erik@matrix.org> | 2016-01-29 10:00:45 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-01-29 10:00:45 +0000 |
commit | 50e18938a96583b2dc8cbc69aa7182a35e3435af (patch) | |
tree | f4cbbe20f8519302cd6063d9eae77a1d62d88cee /synapse/util/caches/lrucache.py | |
parent | Prune on fetching (diff) | |
download | synapse-50e18938a96583b2dc8cbc69aa7182a35e3435af.tar.xz |
Reset size on clear
Diffstat (limited to '')
-rw-r--r-- | synapse/util/caches/lrucache.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/util/caches/lrucache.py b/synapse/util/caches/lrucache.py index e6a66dc041..5182cadb9e 100644 --- a/synapse/util/caches/lrucache.py +++ b/synapse/util/caches/lrucache.py @@ -37,6 +37,7 @@ class LruCache(object): """ def __init__(self, max_size, keylen=1, cache_type=dict): cache = cache_type() + self.cache = cache # Used for introspection. self.size = 0 list_root = [] list_root[:] = [list_root, list_root, None, None] @@ -142,6 +143,7 @@ class LruCache(object): list_root[NEXT] = list_root list_root[PREV] = list_root cache.clear() + self.size = 0 @synchronized def cache_len(): |