summary refs log tree commit diff
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-03-06 15:17:50 +0000
committerKegan Dougal <kegan@matrix.org>2015-03-06 15:17:50 +0000
commit7d3491c74180461dc9d49fc89dad233e240ac475 (patch)
tree833e6fdb08137881e04b693aa895e02480848a84
parentFlesh out more stub functions. (diff)
downloadsynapse-7d3491c74180461dc9d49fc89dad233e240ac475.tar.xz
Add some loggers
-rw-r--r--synapse/appservice/scheduler.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/appservice/scheduler.py b/synapse/appservice/scheduler.py
index 99e83747a8..2b3aa3b0ea 100644
--- a/synapse/appservice/scheduler.py
+++ b/synapse/appservice/scheduler.py
@@ -171,6 +171,10 @@ class _TransactionController(object):
 
     @defer.inlineCallbacks
     def on_recovered(self, recoverer):
+        self.recoverers.remove(recoverer)
+        logger.info("Successfully recovered application service: %s",
+                    recoverer.service)
+        logger.info("Active recoverers: %s", len(self.recoverers))
         applied_state = yield self.store.set_appservice_state(
             recoverer.service,
             ApplicationServiceState.UP
@@ -182,6 +186,8 @@ class _TransactionController(object):
     def add_recoverers(self, recoverers):
         for r in recoverers:
             self.recoverers.append(r)
+        if len(recoverers) > 0:
+            logger.info("Active recoverers: %s", len(self.recoverers))
 
     @defer.inlineCallbacks
     def _start_recoverer(self, service):
@@ -190,6 +196,10 @@ class _TransactionController(object):
             ApplicationServiceState.DOWN
         )
         if applied_state:
+            logger.info(
+                "Application service falling behind. Starting recoverer. %s",
+                service
+            )
             recoverer = self.recoverer_fn(service, self.on_recovered)
             self.add_recoverers([recoverer])
             recoverer.recover()