mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-29 15:39:00 +03:00
Add some loggers
This commit is contained in:
parent
f260cb72cd
commit
7d3491c741
1 changed files with 10 additions and 0 deletions
|
@ -171,6 +171,10 @@ class _TransactionController(object):
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def on_recovered(self, recoverer):
|
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(
|
applied_state = yield self.store.set_appservice_state(
|
||||||
recoverer.service,
|
recoverer.service,
|
||||||
ApplicationServiceState.UP
|
ApplicationServiceState.UP
|
||||||
|
@ -182,6 +186,8 @@ class _TransactionController(object):
|
||||||
def add_recoverers(self, recoverers):
|
def add_recoverers(self, recoverers):
|
||||||
for r in recoverers:
|
for r in recoverers:
|
||||||
self.recoverers.append(r)
|
self.recoverers.append(r)
|
||||||
|
if len(recoverers) > 0:
|
||||||
|
logger.info("Active recoverers: %s", len(self.recoverers))
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def _start_recoverer(self, service):
|
def _start_recoverer(self, service):
|
||||||
|
@ -190,6 +196,10 @@ class _TransactionController(object):
|
||||||
ApplicationServiceState.DOWN
|
ApplicationServiceState.DOWN
|
||||||
)
|
)
|
||||||
if applied_state:
|
if applied_state:
|
||||||
|
logger.info(
|
||||||
|
"Application service falling behind. Starting recoverer. %s",
|
||||||
|
service
|
||||||
|
)
|
||||||
recoverer = self.recoverer_fn(service, self.on_recovered)
|
recoverer = self.recoverer_fn(service, self.on_recovered)
|
||||||
self.add_recoverers([recoverer])
|
self.add_recoverers([recoverer])
|
||||||
recoverer.recover()
|
recoverer.recover()
|
||||||
|
|
Loading…
Reference in a new issue