summary refs log tree commit diff
path: root/synapse/appservice
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-04-27 14:31:23 +0100
committerRichard van der Hoff <richard@matrix.org>2018-04-27 14:31:23 +0100
commitfc149b4eeb560286f4b54f53619b69089eeeaff8 (patch)
treea237b7a346ebf7c6db550ee65451a903c8ecf2d3 /synapse/appservice
parentUse run_in_background in preference to preserve_fn (diff)
parentMerge branch 'master' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-fc149b4eeb560286f4b54f53619b69089eeeaff8.tar.xz
Merge remote-tracking branch 'origin/develop' into rav/use_run_in_background
Diffstat (limited to 'synapse/appservice')
-rw-r--r--synapse/appservice/scheduler.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/synapse/appservice/scheduler.py b/synapse/appservice/scheduler.py
index ba1631b5c8..6eddbc0828 100644
--- a/synapse/appservice/scheduler.py
+++ b/synapse/appservice/scheduler.py
@@ -176,17 +176,20 @@ class _TransactionController(object):
 
     @defer.inlineCallbacks
     def _start_recoverer(self, service):
-        yield self.store.set_appservice_state(
-            service,
-            ApplicationServiceState.DOWN
-        )
-        logger.info(
-            "Application service falling behind. Starting recoverer. AS ID %s",
-            service.id
-        )
-        recoverer = self.recoverer_fn(service, self.on_recovered)
-        self.add_recoverers([recoverer])
-        recoverer.recover()
+        try:
+            yield self.store.set_appservice_state(
+                service,
+                ApplicationServiceState.DOWN
+            )
+            logger.info(
+                "Application service falling behind. Starting recoverer. AS ID %s",
+                service.id
+            )
+            recoverer = self.recoverer_fn(service, self.on_recovered)
+            self.add_recoverers([recoverer])
+            recoverer.recover()
+        except Exception:
+            logger.exception("Error starting AS recoverer")
 
     @defer.inlineCallbacks
     def _is_service_up(self, service):