mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:46:01 -04:00
Merge pull request #2185 from matrix-org/erikj/smaller_caches
Optimise caches for single key
This commit is contained in:
commit
e3aa8a7aa8
2 changed files with 35 additions and 11 deletions
|
@ -148,7 +148,7 @@ class RoomMemberStore(SQLBaseStore):
|
|||
hosts = frozenset(get_domain_from_id(user_id) for user_id in user_ids)
|
||||
defer.returnValue(hosts)
|
||||
|
||||
@cached(max_entries=500000, iterable=True)
|
||||
@cached(max_entries=100000, iterable=True)
|
||||
def get_users_in_room(self, room_id):
|
||||
def f(txn):
|
||||
sql = (
|
||||
|
@ -161,7 +161,7 @@ class RoomMemberStore(SQLBaseStore):
|
|||
)
|
||||
|
||||
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)
|
||||
|
||||
@cached()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue