summary refs log tree commit diff
path: root/synapse/storage/background_updates.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-07-23 13:21:15 +0100
committerErik Johnston <erik@matrix.org>2018-07-23 13:21:15 +0100
commit0b0b24cb82d3337bef5d3dd4b960990934d8d5c5 (patch)
tree3cbf0143b30ef340a91a99f5d491ee2eb7aa5e8c /synapse/storage/background_updates.py
parentUpdate docs/workers.rst (diff)
parentMerge pull request #3520 from matrix-org/matthew/sync_deleted_devices (diff)
downloadsynapse-0b0b24cb82d3337bef5d3dd4b960990934d8d5c5.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/client_apis_move
Diffstat (limited to 'synapse/storage/background_updates.py')
-rw-r--r--synapse/storage/background_updates.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/storage/background_updates.py b/synapse/storage/background_updates.py
index dc9eca7d15..5fe1ca2de7 100644
--- a/synapse/storage/background_updates.py
+++ b/synapse/storage/background_updates.py
@@ -19,6 +19,8 @@ from canonicaljson import json
 
 from twisted.internet import defer
 
+from synapse.metrics.background_process_metrics import run_as_background_process
+
 from . import engines
 from ._base import SQLBaseStore
 
@@ -87,10 +89,14 @@ class BackgroundUpdateStore(SQLBaseStore):
         self._background_update_handlers = {}
         self._all_done = False
 
-    @defer.inlineCallbacks
     def start_doing_background_updates(self):
-        logger.info("Starting background schema updates")
+        run_as_background_process(
+            "background_updates", self._run_background_updates,
+        )
 
+    @defer.inlineCallbacks
+    def _run_background_updates(self):
+        logger.info("Starting background schema updates")
         while True:
             yield self.hs.get_clock().sleep(
                 self.BACKGROUND_UPDATE_INTERVAL_MS / 1000.)