diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2020-06-15 16:37:52 +0100 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2020-06-15 16:37:52 +0100 |
commit | 6efb2b0ad44b4cfb1f05a77c1a5a22b527758b37 (patch) | |
tree | 56c11988292ef856c99e8fb4f9b08b648e5d93d8 /synapse/util/caches/expiringcache.py | |
parent | Merge branch 'develop' into babolivier/mark_unread (diff) | |
parent | Discard RDATA from already seen positions. (#7648) (diff) | |
download | synapse-6efb2b0ad44b4cfb1f05a77c1a5a22b527758b37.tar.xz |
Merge branch 'develop' into babolivier/mark_unread
Diffstat (limited to 'synapse/util/caches/expiringcache.py')
-rw-r--r-- | synapse/util/caches/expiringcache.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/synapse/util/caches/expiringcache.py b/synapse/util/caches/expiringcache.py index 2726b67b6d..89a3420f92 100644 --- a/synapse/util/caches/expiringcache.py +++ b/synapse/util/caches/expiringcache.py @@ -16,8 +16,6 @@ import logging from collections import OrderedDict -from six import iteritems, itervalues - from synapse.config import cache as cache_config from synapse.metrics.background_process_metrics import run_as_background_process from synapse.util.caches import register_cache @@ -150,7 +148,7 @@ class ExpiringCache(object): keys_to_delete = set() - for key, cache_entry in iteritems(self._cache): + for key, cache_entry in self._cache.items(): if now - cache_entry.time > self._expiry_ms: keys_to_delete.add(key) @@ -170,7 +168,7 @@ class ExpiringCache(object): def __len__(self): if self.iterable: - return sum(len(entry.value) for entry in itervalues(self._cache)) + return sum(len(entry.value) for entry in self._cache.values()) else: return len(self._cache) |