summary refs log tree commit diff
path: root/synapse/handlers/appservice.py
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2018-07-24 12:39:54 +0100
committerMatthew Hodgson <matthew@matrix.org>2018-07-24 12:39:54 +0100
commitd19fba365505f4fe475d641dce58c4ecce953f8b (patch)
treeb386cb6fe6b90c720d2f1fe6139d4e079ba5a814 /synapse/handlers/appservice.py
parentincorporate more review (diff)
parentMerge pull request #3591 from matrix-org/rav/logcontext_fixes (diff)
downloadsynapse-d19fba365505f4fe475d641dce58c4ecce953f8b.tar.xz
Merge branch 'develop' into matthew/filter_members
Diffstat (limited to 'synapse/handlers/appservice.py')
-rw-r--r--synapse/handlers/appservice.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py
index ec9fe01a5a..ee41aed69e 100644
--- a/synapse/handlers/appservice.py
+++ b/synapse/handlers/appservice.py
@@ -23,6 +23,7 @@ from twisted.internet import defer
 
 import synapse
 from synapse.api.constants import EventTypes
+from synapse.metrics.background_process_metrics import run_as_background_process
 from synapse.util.logcontext import make_deferred_yieldable, run_in_background
 from synapse.util.metrics import Measure
 
@@ -106,7 +107,9 @@ class ApplicationServicesHandler(object):
                             yield self._check_user_exists(event.state_key)
 
                         if not self.started_scheduler:
-                            self.scheduler.start().addErrback(log_failure)
+                            def start_scheduler():
+                                return self.scheduler.start().addErrback(log_failure)
+                            run_as_background_process("as_scheduler", start_scheduler)
                             self.started_scheduler = True
 
                         # Fork off pushes to these services