Disable statement timeout during room purge (#18017)
This is already done for `purge_history` but seems to have been forgotten for `purge_room`.
This commit is contained in:
parent
bd9a1079bc
commit
234d07eb09
|
@ -0,0 +1 @@
|
|||
Disable DB statement timeout when doing a purge room since it can be quite long.
|
|
@ -376,6 +376,11 @@ class PurgeEventsStore(StateGroupWorkerStore, CacheInvalidationWorkerStore):
|
|||
(room_id,),
|
||||
)
|
||||
|
||||
if isinstance(self.database_engine, PostgresEngine):
|
||||
# Disable statement timeouts for this transaction; purging rooms can
|
||||
# take a while!
|
||||
txn.execute("SET LOCAL statement_timeout = 0")
|
||||
|
||||
# First, fetch all the state groups that should be deleted, before
|
||||
# we delete that information.
|
||||
txn.execute(
|
||||
|
|
Loading…
Reference in New Issue