Tentative to find how to reconnect after lost connection

This commit is contained in:
Adrien Bourmault 2022-02-09 11:10:50 +01:00
parent 6c2d15b0e2
commit e23e1a49d8
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
1 changed files with 9 additions and 0 deletions

View File

@ -96,6 +96,8 @@ if __name__ == '__main__':
localservthread = LocalServer(store) localservthread = LocalServer(store)
localservthread.start() localservthread.start()
ERRORS = 0
while True: while True:
time.sleep(1) time.sleep(1)
@ -110,3 +112,10 @@ if __name__ == '__main__':
xmpp.process() xmpp.process()
except KeyboardInterrupt: except KeyboardInterrupt:
cleanExit() cleanExit()
except Exception as e:
log.error(str(e))
if ERRORS >= 3:
log.critical("3 consecutive errors. Aborting...")
cleanExit()
ERRORS += 1