summary refs log tree commit diff
path: root/synapse/storage/event_push_actions.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-05-13 14:41:36 +0100
committerErik Johnston <erik@matrix.org>2016-05-13 14:41:36 +0100
commite00e8f21660c021a4d93edd9531102ba1d5440e9 (patch)
tree3879bca04f72c0dc2d62b467595db63a4f9fab1b /synapse/storage/event_push_actions.py
parentMerge pull request #779 from matrix-org/erikj/receipts (diff)
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/push_actio... (diff)
downloadsynapse-e00e8f21660c021a4d93edd9531102ba1d5440e9.tar.xz
Merge pull request #769 from matrix-org/erikj/push_actions_delete
Delete old pushers
Diffstat (limited to 'synapse/storage/event_push_actions.py')
-rw-r--r--synapse/storage/event_push_actions.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/storage/event_push_actions.py b/synapse/storage/event_push_actions.py
index 6f316f7d24..9705db5c47 100644
--- a/synapse/storage/event_push_actions.py
+++ b/synapse/storage/event_push_actions.py
@@ -224,6 +224,18 @@ class EventPushActionsStore(SQLBaseStore):
             (room_id, event_id)
         )
 
+    def _remove_push_actions_before_txn(self, txn, room_id, user_id,
+                                        topological_ordering):
+        txn.call_after(
+            self.get_unread_event_push_actions_by_room_for_user.invalidate_many,
+            (room_id, user_id, )
+        )
+        txn.execute(
+            "DELETE FROM event_push_actions"
+            " WHERE room_id = ? AND user_id = ? AND topological_ordering < ?",
+            (room_id, user_id, topological_ordering,)
+        )
+
 
 def _action_has_highlight(actions):
     for action in actions: