summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-03-18 11:19:47 +0000
committerErik Johnston <erik@matrix.org>2015-03-18 11:19:47 +0000
commitbb246091585dc648177f70a022a185784b3ff862 (patch)
tree25a61d7c25bce51bd2b7a697854b6a2209c8faf6 /synapse/storage
parent@cached() annotate get_user_by_token() - achieves a minor DB performance impr... (diff)
downloadsynapse-bb246091585dc648177f70a022a185784b3ff862.tar.xz
Clean out event_forward_extremities table when the server rejoins the room
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/event_federation.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py
index 2deda8ac50..032334bfd6 100644
--- a/synapse/storage/event_federation.py
+++ b/synapse/storage/event_federation.py
@@ -429,3 +429,15 @@ class EventFederationStore(SQLBaseStore):
         )
 
         return events[:limit]
+
+    def clean_room_for_join(self, room_id):
+        return self.runInteraction(
+            "clean_room_for_join",
+            self._clean_room_for_join_txn,
+            room_id,
+        )
+
+    def _clean_room_for_join_txn(self, txn, room_id):
+        query = "DELETE FROM event_forward_extremities WHERE room_id = ?"
+
+        txn.execute(query, (room_id,))