Tentative to find how to reconnect after lost connection
This commit is contained in:
parent
6c2d15b0e2
commit
e23e1a49d8
9
main.py
9
main.py
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue