Skip to content
Snippets Groups Projects
Unverified Commit 234d07eb authored by Mathieu Velten's avatar Mathieu Velten Committed by GitHub
Browse files

Disable statement timeout during room purge (#18017)

This is already done for `purge_history` but seems to have been
forgotten for `purge_room`.
parent bd9a1079
No related branches found
No related tags found
No related merge requests found
Disable DB statement timeout when doing a purge room since it can be quite long.
...@@ -376,6 +376,11 @@ class PurgeEventsStore(StateGroupWorkerStore, CacheInvalidationWorkerStore): ...@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment