Clear list entry when lost connection

This commit is contained in:
Waldek 2020-06-29 13:27:06 +02:00 committed by GitHub
parent d41b3319ee
commit 8d489fc18b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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')