diff --git a/synapse/storage/databases/main/events_worker.py b/synapse/storage/databases/main/events_worker.py index 5d7ecefc7142..dd0ee17b2eea 100644 --- a/synapse/storage/databases/main/events_worker.py +++ b/synapse/storage/databases/main/events_worker.py @@ -736,7 +736,7 @@ async def _invalidate_get_event_cache(self, event_id: str) -> None: self._invalidate_local_get_event_cache(event_id) def _invalidate_local_get_event_cache(self, event_id: str) -> None: - self._get_event_cache.lru_cache.invalidate((event_id,)) + self._get_event_cache.invalidate_local((event_id,)) self._event_ref.pop(event_id, None) self._current_event_fetches.pop(event_id, None) diff --git a/synapse/util/caches/lrucache.py b/synapse/util/caches/lrucache.py index 2f47b7885111..4ce7d7a602ab 100644 --- a/synapse/util/caches/lrucache.py +++ b/synapse/util/caches/lrucache.py @@ -753,6 +753,9 @@ async def set(self, key: KT, value: VT) -> None: async def invalidate(self, key: KT) -> None: return self.lru_cache.invalidate(key) + def invalidate_local(self, key: KT) -> None: + return self.lru_cache.invalidate(key) + async def contains(self, key: KT) -> bool: return self.lru_cache.contains(key)