diff options
author | Hubert Chathi <hubert@uhoreg.ca> | 2019-10-30 10:17:10 -0400 |
---|---|---|
committer | Hubert Chathi <hubert@uhoreg.ca> | 2019-10-30 10:17:10 -0400 |
commit | 7d7eac61be337b7a3ed7274a13e131f41d0966d9 (patch) | |
tree | e6f70c499902b00ed0450e24bb4132e3079698e6 /synapse/storage/background_updates.py | |
parent | black (diff) | |
parent | Merge pull request #6240 from matrix-org/erikj/split_out_persistence_store (diff) | |
download | synapse-7d7eac61be337b7a3ed7274a13e131f41d0966d9.tar.xz |
Merge branch 'develop' into cross-signing_federation
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( |