mirror of
https://github.com/element-hq/synapse
synced 2024-08-20 10:50:21 +00:00
Mitigate jump to date slowness by adding 30s timeout
This commit is contained in:
parent
43c54ba753
commit
cbf1cebef3
1 changed files with 4 additions and 0 deletions
|
@ -2276,6 +2276,10 @@ class EventsWorkerStore(SQLBaseStore):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def get_event_id_for_timestamp_txn(txn: LoggingTransaction) -> Optional[str]:
|
def get_event_id_for_timestamp_txn(txn: LoggingTransaction) -> Optional[str]:
|
||||||
|
if isinstance(self.database_engine, PostgresEngine):
|
||||||
|
# Temporary: make sure these queries can't last more than 30s
|
||||||
|
txn.execute("SET LOCAL statement_timeout = 30000")
|
||||||
|
|
||||||
txn.execute(
|
txn.execute(
|
||||||
sql_template,
|
sql_template,
|
||||||
(room_id, timestamp),
|
(room_id, timestamp),
|
||||||
|
|
Loading…
Reference in a new issue