diff options
author | Erik Johnston <erik@matrix.org> | 2022-03-25 14:58:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-25 14:58:56 +0000 |
commit | 7ca8ee67a5165e33f03454218c81be96397e7591 (patch) | |
tree | e847a8e53e76b7dfc330e66f28d3ce6e6a3f73e7 /synapse/storage/databases/main/cache.py | |
parent | Enhance logging for inbound federation events (#12301) (diff) | |
download | synapse-7ca8ee67a5165e33f03454218c81be96397e7591.tar.xz |
Add cache for `get_membership_from_event_ids` (#12272)
This should speed up push rule calculations for rooms with large numbers of local users when the main push rule cache fails. Co-authored-by: reivilibre <oliverw@matrix.org>
Diffstat (limited to 'synapse/storage/databases/main/cache.py')
-rw-r--r-- | synapse/storage/databases/main/cache.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/cache.py b/synapse/storage/databases/main/cache.py index 2d7511d613..dd4e83a2ad 100644 --- a/synapse/storage/databases/main/cache.py +++ b/synapse/storage/databases/main/cache.py @@ -192,6 +192,10 @@ class CacheInvalidationWorkerStore(SQLBaseStore): self.get_unread_event_push_actions_by_room_for_user.invalidate((room_id,)) + # The `_get_membership_from_event_id` is immutable, except for the + # case where we look up an event *before* persisting it. + self._get_membership_from_event_id.invalidate((event_id,)) + if not backfilled: self._events_stream_cache.entity_has_changed(room_id, stream_ordering) |