summary refs log tree commit diff
path: root/synapse/storage/roommember.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-05-16 17:40:55 +0100
committerGitHub <noreply@github.com>2017-05-16 17:40:55 +0100
commit6fa8148ccbf0e645b5f87dcb5ab93fa13c95191d (patch)
tree6d4028791cc5656b90be063abdc2f7b2e73f68f4 /synapse/storage/roommember.py
parentMerge pull request #2227 from matrix-org/erikj/presence_caches (diff)
parentSpeed up get_joined_hosts (diff)
downloadsynapse-6fa8148ccbf0e645b5f87dcb5ab93fa13c95191d.tar.xz
Merge pull request #2228 from matrix-org/erikj/speed_up_get_hosts
Speed up get_joined_hosts
Diffstat (limited to '')
-rw-r--r--synapse/storage/roommember.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py
index 2fa20bd87c..404f3583eb 100644
--- a/synapse/storage/roommember.py
+++ b/synapse/storage/roommember.py
@@ -534,7 +534,7 @@ class RoomMemberStore(SQLBaseStore):
         assert state_group is not None
 
         joined_hosts = set()
-        for (etype, state_key), event_id in current_state_ids.items():
+        for etype, state_key in current_state_ids:
             if etype == EventTypes.Member:
                 try:
                     host = get_domain_from_id(state_key)
@@ -545,6 +545,7 @@ class RoomMemberStore(SQLBaseStore):
                 if host in joined_hosts:
                     continue
 
+                event_id = current_state_ids[(etype, state_key)]
                 event = yield self.get_event(event_id, allow_none=True)
                 if event and event.content["membership"] == Membership.JOIN:
                     joined_hosts.add(intern_string(host))