mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Clean out event_forward_extremities table when the server rejoins the room
This commit is contained in:
parent
93978c5e2b
commit
bb24609158
@ -290,6 +290,8 @@ class FederationHandler(BaseHandler):
|
|||||||
"""
|
"""
|
||||||
logger.debug("Joining %s to %s", joinee, room_id)
|
logger.debug("Joining %s to %s", joinee, room_id)
|
||||||
|
|
||||||
|
yield self.store.clean_room_for_join(room_id)
|
||||||
|
|
||||||
origin, pdu = yield self.replication_layer.make_join(
|
origin, pdu = yield self.replication_layer.make_join(
|
||||||
target_hosts,
|
target_hosts,
|
||||||
room_id,
|
room_id,
|
||||||
|
@ -429,3 +429,15 @@ class EventFederationStore(SQLBaseStore):
|
|||||||
)
|
)
|
||||||
|
|
||||||
return events[:limit]
|
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,))
|
||||||
|
Loading…
Reference in New Issue
Block a user