Keep trying to reconnect after losing connection / connection failure
This commit is contained in:
parent
b2c4550ed2
commit
4585b2798a
|
@ -88,14 +88,12 @@ class PyIRCBot(asynchat.async_chat):
|
||||||
self.connected=False
|
self.connected=False
|
||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
self.log.warning("Connection was lost.")
|
self.log.warning("Connection was lost. Reconnecting in 5 seconds.")
|
||||||
|
time.sleep(5)
|
||||||
#self.log.warning("Connection was lost. Reconnecting in 5 seconds.")
|
self._connect()
|
||||||
#time.sleep(5)
|
|
||||||
#self._connect()
|
|
||||||
|
|
||||||
def handle_error(self, *args, **kwargs):
|
def handle_error(self, *args, **kwargs):
|
||||||
raise
|
self.log.warning("Connection failed.")
|
||||||
|
|
||||||
def _connect(self):
|
def _connect(self):
|
||||||
self.log.debug("Connecting to %(server)s:%(port)i", {"server":self.botconfig["connection"]["server"], "port":self.botconfig["connection"]["port"]})
|
self.log.debug("Connecting to %(server)s:%(port)i", {"server":self.botconfig["connection"]["server"], "port":self.botconfig["connection"]["port"]})
|
||||||
|
|
Loading…
Reference in New Issue