summary refs log tree commit diff
path: root/synapse/storage/roommember.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-05-05 17:32:21 +0100
committerMark Haines <mark.haines@matrix.org>2015-05-05 17:32:21 +0100
commitd18f37e026a02b4e899bc96e600850007a613189 (patch)
tree66faf9320e35abcc03d0ff31a767a0de2fefddc8 /synapse/storage/roommember.py
parentSYN-369: Add comments to the sequence number logic in the cache (diff)
downloadsynapse-d18f37e026a02b4e899bc96e600850007a613189.tar.xz
Collect the invalidate callbacks on the transaction object rather than passing around a separate list
Diffstat (limited to 'synapse/storage/roommember.py')
-rw-r--r--synapse/storage/roommember.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py
index 117da817ba..839c74f63a 100644
--- a/synapse/storage/roommember.py
+++ b/synapse/storage/roommember.py
@@ -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.