From ba5856c1586b869e6f5f71637bf3c76b4f3c330a Mon Sep 17 00:00:00 2001 From: Jason Little Date: Mon, 13 Nov 2023 04:26:37 -0600 Subject: [PATCH] Set reactor clock into the class instance --- synapse/storage/databases/main/event_federation.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/synapse/storage/databases/main/event_federation.py b/synapse/storage/databases/main/event_federation.py index 3a081abaee5c..cb5b5d4cdd86 100644 --- a/synapse/storage/databases/main/event_federation.py +++ b/synapse/storage/databases/main/event_federation.py @@ -130,6 +130,7 @@ def __init__( super().__init__(database, db_conn, hs) self.hs = hs + self._clock = hs.get_clock() if hs.config.worker.run_background_tasks: hs.get_clock().looping_call( @@ -289,7 +290,7 @@ def _get_auth_chain_ids_using_cover_index_txn( s1 = self._authchain_event_id_to_chain_info.set with Measure( - self.hs.get_clock(), + self._clock, "_get_auth_chain_ids_using_cover_index_txn.section_1_all", ): initial_events_copy = set(initial_events) @@ -366,7 +367,7 @@ def _get_auth_chain_ids_using_cover_index_txn( s2 = self._authchain_links_list.set with Measure( - self.hs.get_clock(), + self._clock, "_get_auth_chain_ids_using_cover_index_txn.section_2_all", ): # 'event_chains' represents the origin chain_id and maximum sequence number @@ -468,7 +469,7 @@ def _get_auth_chain_ids_using_cover_index_txn( s3 = self._authchain_chain_info_to_event_id.set with Measure( - self.hs.get_clock(), + self._clock, "_get_auth_chain_ids_using_cover_index_txn.section_3_all", ): while len(chains) != 0: