Skip to content
Snippets Groups Projects
Commit 69d40636 authored by Erik Johnston's avatar Erik Johnston
Browse files

Add get_rooms_for_user cache

parent 5b02f334
No related branches found
No related tags found
No related merge requests found
...@@ -65,6 +65,7 @@ class RoomMemberStore(SQLBaseStore): ...@@ -65,6 +65,7 @@ class RoomMemberStore(SQLBaseStore):
) )
self.get_rooms_for_user.invalidate(target_user_id) self.get_rooms_for_user.invalidate(target_user_id)
self.get_joined_hosts_for_room.invalidate(event.room_id)
def get_room_member(self, user_id, room_id): def get_room_member(self, user_id, room_id):
"""Retrieve the current state of a room member. """Retrieve the current state of a room member.
...@@ -162,6 +163,7 @@ class RoomMemberStore(SQLBaseStore): ...@@ -162,6 +163,7 @@ class RoomMemberStore(SQLBaseStore):
RoomsForUser(**r) for r in self.cursor_to_dict(txn) RoomsForUser(**r) for r in self.cursor_to_dict(txn)
] ]
@cached()
def get_joined_hosts_for_room(self, room_id): def get_joined_hosts_for_room(self, room_id):
return self.runInteraction( return self.runInteraction(
"get_joined_hosts_for_room", "get_joined_hosts_for_room",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment