Keep trying to reconnect after losing connection / connection failure

This commit is contained in:
dave 2014-09-09 20:09:01 -07:00
parent b2c4550ed2
commit 4585b2798a
1 changed files with 4 additions and 6 deletions

View File

@ -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"]})