mirror of
https://github.com/element-hq/synapse.git
synced 2025-01-20 18:42:33 +00:00
Disable statement timeout during room purge
This commit is contained in:
parent
790ce14e46
commit
775b2de9f0
2 changed files with 6 additions and 0 deletions
1
changelog.d/18017.misc
Normal file
1
changelog.d/18017.misc
Normal file
|
@ -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,),
|
(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
|
# First, fetch all the state groups that should be deleted, before
|
||||||
# we delete that information.
|
# we delete that information.
|
||||||
txn.execute(
|
txn.execute(
|
||||||
|
|
Loading…
Add table
Reference in a new issue