diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-04-27 14:31:23 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-04-27 14:31:23 +0100 |
commit | fc149b4eeb560286f4b54f53619b69089eeeaff8 (patch) | |
tree | a237b7a346ebf7c6db550ee65451a903c8ecf2d3 /synapse/appservice/scheduler.py | |
parent | Use run_in_background in preference to preserve_fn (diff) | |
parent | Merge branch 'master' of github.com:matrix-org/synapse into develop (diff) | |
download | synapse-fc149b4eeb560286f4b54f53619b69089eeeaff8.tar.xz |
Merge remote-tracking branch 'origin/develop' into rav/use_run_in_background
Diffstat (limited to 'synapse/appservice/scheduler.py')
-rw-r--r-- | synapse/appservice/scheduler.py | 25 |
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): |