From e23e1a49d8ca32e4dabb8b9b8776f6d6794bb941 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Wed, 9 Feb 2022 11:10:50 +0100 Subject: [PATCH] Tentative to find how to reconnect after lost connection --- main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.py b/main.py index 5dde52d..119ff54 100755 --- a/main.py +++ b/main.py @@ -96,6 +96,8 @@ if __name__ == '__main__': localservthread = LocalServer(store) localservthread.start() + ERRORS = 0 + while True: time.sleep(1) @@ -110,3 +112,10 @@ if __name__ == '__main__': xmpp.process() except KeyboardInterrupt: cleanExit() + except Exception as e: + log.error(str(e)) + if ERRORS >= 3: + log.critical("3 consecutive errors. Aborting...") + cleanExit() + + ERRORS += 1