From 8d489fc18bd5f1ef263fb907153fdbb08964ce00 Mon Sep 17 00:00:00 2001 From: Waldek Date: Mon, 29 Jun 2020 13:27:06 +0200 Subject: [PATCH] Clear list entry when lost connection --- monitor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/monitor.py b/monitor.py index 6ac125d..18a0e31 100644 --- a/monitor.py +++ b/monitor.py @@ -464,7 +464,7 @@ def build_stats(): if CONFIG: table = 'd' + dtemplate.render(_table=CTABLE) dashboard_server.broadcast(table) - if BRIDGES: + if BRIDGES and BRIDGES_INC: table = 'b' + btemplate.render(_table=BTABLE['BRIDGES']) dashboard_server.broadcast(table) build_time = now @@ -687,6 +687,10 @@ class reportClientFactory(ReconnectingClientFactory): return report() def clientConnectionLost(self, connector, reason): + CTABLE['MASTERS'].clear() + CTABLE['PEERS'].clear() + CTABLE['OPENBRIDGES'].clear() + BTABLE['BRIDGES'].clear() logging.info('Lost connection. Reason: %s', reason) ReconnectingClientFactory.clientConnectionLost(self, connector, reason) dashboard_server.broadcast('q' + 'Connection to HBlink Lost')