Collect the invalidate callbacks on the transaction object rather than passing around a separate list

This commit is contained in:
Mark Haines 2015-05-05 17:32:21 +01:00
parent 041b6cba61
commit d18f37e026
7 changed files with 51 additions and 51 deletions

View file

@ -35,7 +35,7 @@ RoomsForUser = namedtuple(
class RoomMemberStore(SQLBaseStore):
def _store_room_member_txn(self, txn, invalidates, event):
def _store_room_member_txn(self, txn, event):
"""Store a room member in the database.
"""
try:
@ -64,10 +64,8 @@ class RoomMemberStore(SQLBaseStore):
}
)
invalidates.extend([
(self.get_rooms_for_user.invalidate, target_user_id),
(self.get_joined_hosts_for_room.invalidate, event.room_id),
])
txn.call_after(self.get_rooms_for_user.invalidate, target_user_id)
txn.call_after(self.get_joined_hosts_for_room.invalidate, event.room_id)
def get_room_member(self, user_id, room_id):
"""Retrieve the current state of a room member.