Skip to content

Commit

Permalink
Set reactor clock into the class instance
Browse files Browse the repository at this point in the history
  • Loading branch information
realtyem committed Nov 13, 2023
1 parent f3ebc26 commit ba5856c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions synapse/storage/databases/main/event_federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ba5856c

Please sign in to comment.