diff options
author | Hubert Chathi <hubert@uhoreg.ca> | 2019-10-30 16:46:31 -0400 |
---|---|---|
committer | Hubert Chathi <hubert@uhoreg.ca> | 2019-10-30 16:46:31 -0400 |
commit | 670972c0e1b98690480b7eac3a4b9b863e8d6761 (patch) | |
tree | e1c3fc0059a7df9da7a91385452eda28585dfc76 /synapse/storage/background_updates.py | |
parent | add changelog (diff) | |
parent | Merge pull request #6240 from matrix-org/erikj/split_out_persistence_store (diff) | |
download | synapse-670972c0e1b98690480b7eac3a4b9b863e8d6761.tar.xz |
Merge branch 'develop' into uhoreg/cross_signing_fix_workers_notify
Diffstat (limited to 'synapse/storage/background_updates.py')
-rw-r--r-- | synapse/storage/background_updates.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/storage/background_updates.py b/synapse/storage/background_updates.py index 80b57a948c..37d469ffd7 100644 --- a/synapse/storage/background_updates.py +++ b/synapse/storage/background_updates.py @@ -94,13 +94,16 @@ class BackgroundUpdateStore(SQLBaseStore): self._all_done = False def start_doing_background_updates(self): - run_as_background_process("background_updates", self._run_background_updates) + run_as_background_process("background_updates", self.run_background_updates) @defer.inlineCallbacks - def _run_background_updates(self): + def run_background_updates(self, sleep=True): logger.info("Starting background schema updates") while True: - yield self.hs.get_clock().sleep(self.BACKGROUND_UPDATE_INTERVAL_MS / 1000.0) + if sleep: + yield self.hs.get_clock().sleep( + self.BACKGROUND_UPDATE_INTERVAL_MS / 1000.0 + ) try: result = yield self.do_next_background_update( |