summary refs log tree commit diff
path: root/synapse/storage/databases/main/roommember.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-08-04 13:54:51 +0100
committerGitHub <noreply@github.com>2021-08-04 13:54:51 +0100
commitc37dad67ab04980ac934554399f52a27e54292ab (patch)
treea985ffee098a29c8c894b056b9437143a9d961e7 /synapse/storage/databases/main/roommember.py
parentFix `could not serialize access` errors for `claim_e2e_one_time_keys` (#10504) (diff)
downloadsynapse-c37dad67ab04980ac934554399f52a27e54292ab.tar.xz
Improve event caching code (#10119)
Ensure we only load an event from the DB once when the same event is requested multiple times at once.
Diffstat (limited to 'synapse/storage/databases/main/roommember.py')
-rw-r--r--synapse/storage/databases/main/roommember.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/synapse/storage/databases/main/roommember.py b/synapse/storage/databases/main/roommember.py
index 68f1b40ea6..e8157ba3d4 100644
--- a/synapse/storage/databases/main/roommember.py
+++ b/synapse/storage/databases/main/roommember.py
@@ -629,14 +629,12 @@ class RoomMemberWorkerStore(EventsWorkerStore):
         # We don't update the event cache hit ratio as it completely throws off
         # the hit ratio counts. After all, we don't populate the cache if we
         # miss it here
-        event_map = self._get_events_from_cache(
-            member_event_ids, allow_rejected=False, update_metrics=False
-        )
+        event_map = self._get_events_from_cache(member_event_ids, update_metrics=False)
 
         missing_member_event_ids = []
         for event_id in member_event_ids:
             ev_entry = event_map.get(event_id)
-            if ev_entry:
+            if ev_entry and not ev_entry.event.rejected_reason:
                 if ev_entry.event.membership == Membership.JOIN:
                     users_in_room[ev_entry.event.state_key] = ProfileInfo(
                         display_name=ev_entry.event.content.get("displayname", None),