mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Socket: Match the expected API of reconnect
driver.reconnect(wait=True) should flag a driver to reconnect, but not
immediately. The Socket driver lost its handling of this flag in
8730832e
.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
parent
a483fef39d
commit
ea7f1f8419
@ -152,7 +152,7 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
|||||||
def connect(self, **kwargs):
|
def connect(self, **kwargs):
|
||||||
self.reconnect(reset=False, **kwargs)
|
self.reconnect(reset=False, **kwargs)
|
||||||
|
|
||||||
def reconnect(self, reset=True):
|
def reconnect(self, wait=False, reset=True):
|
||||||
self.nextReconnectTime = None
|
self.nextReconnectTime = None
|
||||||
if self.connected:
|
if self.connected:
|
||||||
drivers.log.reconnect(self.irc.network)
|
drivers.log.reconnect(self.irc.network)
|
||||||
@ -163,6 +163,9 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
|||||||
self.irc.reset()
|
self.irc.reset()
|
||||||
else:
|
else:
|
||||||
drivers.log.debug('Not resetting %s.', self.irc)
|
drivers.log.debug('Not resetting %s.', self.irc)
|
||||||
|
if wait:
|
||||||
|
self.scheduleReconnect()
|
||||||
|
return
|
||||||
server = self._getNextServer()
|
server = self._getNextServer()
|
||||||
host = server[0]
|
host = server[0]
|
||||||
address = None
|
address = None
|
||||||
|
Loading…
Reference in New Issue
Block a user