mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:36:02 -04:00
Speed up get_joined_hosts
This commit is contained in:
parent
b8492b6c2f
commit
13f540ef1b
2 changed files with 4 additions and 2 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue