Skip to content

Commit 2bb532a

Browse files
committed
Disable statement timeout during room purge
1 parent 790ce14 commit 2bb532a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

synapse/storage/databases/main/purge_events.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,11 @@ def _purge_room_txn(self, txn: LoggingTransaction, room_id: str) -> List[int]:
376376
(room_id,),
377377
)
378378

379+
if isinstance(self.database_engine, PostgresEngine):
380+
# Disable statement timeouts for this transaction; purging rooms can
381+
# take a while!
382+
txn.execute("SET LOCAL statement_timeout = 0")
383+
379384
# First, fetch all the state groups that should be deleted, before
380385
# we delete that information.
381386
txn.execute(

0 commit comments

Comments
 (0)