summary refs log tree commit diff
path: root/synapse/util/caches/expiringcache.py
diff options
context:
space:
mode:
authorPatrick Cloke <patrickc@matrix.org>2023-09-06 11:25:41 -0400
committerPatrick Cloke <patrickc@matrix.org>2023-09-06 11:25:41 -0400
commitec703e7d978565b55be6b8642e9284633d5f43f2 (patch)
tree4da9b54c05d37c794818009d118d73007cad8689 /synapse/util/caches/expiringcache.py
parentMerge remote-tracking branch 'origin/release-v1.92' into matrix-org-hotfixes (diff)
parentMerge remote-tracking branch 'origin/release-v1.91' into release-v1.92 (diff)
downloadsynapse-ec703e7d978565b55be6b8642e9284633d5f43f2.tar.xz
Merge branch 'release-v1.92' into matrix-org-hotfixes
Diffstat (limited to 'synapse/util/caches/expiringcache.py')
-rw-r--r--synapse/util/caches/expiringcache.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/synapse/util/caches/expiringcache.py b/synapse/util/caches/expiringcache.py

index 9a3e10ddee..01ad02af67 100644 --- a/synapse/util/caches/expiringcache.py +++ b/synapse/util/caches/expiringcache.py
@@ -140,20 +140,6 @@ class ExpiringCache(Generic[KT, VT]): return value.value - def invalidate(self, key: KT) -> None: - """ - Remove the given key from the cache. - """ - - value = self._cache.pop(key, None) - if value: - if self.iterable: - self.metrics.inc_evictions( - EvictionReason.invalidation, len(value.value) - ) - else: - self.metrics.inc_evictions(EvictionReason.invalidation) - def __contains__(self, key: KT) -> bool: return key in self._cache @@ -207,14 +193,6 @@ class ExpiringCache(Generic[KT, VT]): len(self), ) - def invalidate_all(self) -> None: - """ - Remove all items from the cache. - """ - keys = set(self._cache.keys()) - for key in keys: - self._cache.pop(key) - def __len__(self) -> int: if self.iterable: return sum(len(entry.value) for entry in self._cache.values())