mirror of
https://github.com/element-hq/synapse
synced 2024-09-04 16:00:07 +00:00
Reduce size of get_users_in_room
This commit is contained in:
parent
60833c8978
commit
5d8290429c
1 changed files with 2 additions and 2 deletions
|
@ -147,7 +147,7 @@ class RoomMemberStore(SQLBaseStore):
|
||||||
hosts = frozenset(get_domain_from_id(user_id) for user_id in user_ids)
|
hosts = frozenset(get_domain_from_id(user_id) for user_id in user_ids)
|
||||||
defer.returnValue(hosts)
|
defer.returnValue(hosts)
|
||||||
|
|
||||||
@cached(max_entries=500000, iterable=True)
|
@cached(max_entries=100000, iterable=True)
|
||||||
def get_users_in_room(self, room_id):
|
def get_users_in_room(self, room_id):
|
||||||
def f(txn):
|
def f(txn):
|
||||||
sql = (
|
sql = (
|
||||||
|
@ -160,7 +160,7 @@ class RoomMemberStore(SQLBaseStore):
|
||||||
)
|
)
|
||||||
|
|
||||||
txn.execute(sql, (room_id, Membership.JOIN,))
|
txn.execute(sql, (room_id, Membership.JOIN,))
|
||||||
return [r[0] for r in txn]
|
return [to_ascii(r[0]) for r in txn]
|
||||||
return self.runInteraction("get_users_in_room", f)
|
return self.runInteraction("get_users_in_room", f)
|
||||||
|
|
||||||
@cached()
|
@cached()
|
||||||
|
|
Loading…
Reference in a new issue