Add log messages to debug reconnection issue
This commit is contained in:
parent
a65295f014
commit
2505da666a
|
@ -69,12 +69,20 @@ class IRCCore(asynchat.async_chat):
|
||||||
try:
|
try:
|
||||||
asyncore.loop(map=self.asynmap, timeout=1)
|
asyncore.loop(map=self.asynmap, timeout=1)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.log.error("Loop error: %s" % str(e))
|
self.log.error("Loop error: ")
|
||||||
|
self.log.error(IRCCore.trace())
|
||||||
|
|
||||||
# Remove from asynmap
|
# Remove from asynmap
|
||||||
for key in list(self.asynmap.keys())[:]:
|
for key in list(self.asynmap.keys())[:]:
|
||||||
del self.asynmap[key]
|
del self.asynmap[key]
|
||||||
|
|
||||||
if self.alive:
|
if self.alive:
|
||||||
|
logging.info("Loop: reconnecting")
|
||||||
|
try:
|
||||||
self._connect()
|
self._connect()
|
||||||
|
except Exception as e2:
|
||||||
|
self.log.error("Error reconnecting: ")
|
||||||
|
self.log.error(IRCCore.trace())
|
||||||
|
|
||||||
def kill(self, message="Help! Another thread is killing me :(", alive=False):
|
def kill(self, message="Help! Another thread is killing me :(", alive=False):
|
||||||
"""Send quit message, flush queue, and close the socket
|
"""Send quit message, flush queue, and close the socket
|
||||||
|
|
Loading…
Reference in New Issue