3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

Set Irc.aborted earlier in the disconnect loop

This prevents plugins from getting really confused as we remove things.
This commit is contained in:
James Lu 2017-08-03 10:22:57 -07:00
parent 0d5afd266f
commit a0a295f7d2

View File

@ -390,6 +390,9 @@ class Irc(utils.DeprecatedAttributesObject):
log.debug('(%s) disconnect: Clearing self.connected state.', self.name)
self.connected.clear()
log.debug('(%s) disconnect: Setting self.aborted to True.', self.name)
self.aborted.set()
log.debug('(%s) Removing channel logging handlers due to disconnect.', self.name)
while self.loghandlers:
log.removeHandler(self.loghandlers.pop())
@ -412,9 +415,6 @@ class Irc(utils.DeprecatedAttributesObject):
log.debug('(%s) Canceling pingTimer at %s due to disconnect() call', self.name, time.time())
self.pingTimer.cancel()
log.debug('(%s) disconnect: Setting self.aborted to True.', self.name)
self.aborted.set()
# Internal hook signifying that a network has disconnected.
self.callHooks([None, 'PYLINK_DISCONNECT', {'was_successful': was_successful}])