3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

fix SQUIT not respecting autoconnect delay

This commit is contained in:
James Lu 2015-07-17 16:01:51 -07:00
parent 95853924ad
commit df595c65a1
2 changed files with 8 additions and 8 deletions

14
main.py
View File

@ -80,13 +80,13 @@ class Irc():
log.warning('(%s) Disconnected from IRC: %s: %s',
self.name, type(e).__name__, str(e))
self.disconnect()
autoconnect = self.serverdata.get('autoconnect')
log.debug('(%s) Autoconnect delay set to %s seconds.', self.name, autoconnect)
if autoconnect is not None and autoconnect >= 0:
log.info('(%s) Going to auto-reconnect in %s seconds.', self.name, autoconnect)
time.sleep(autoconnect)
else:
return
autoconnect = self.serverdata.get('autoconnect')
log.debug('(%s) Autoconnect delay set to %s seconds.', self.name, autoconnect)
if autoconnect is not None and autoconnect >= 0:
log.info('(%s) Going to auto-reconnect in %s seconds.', self.name, autoconnect)
time.sleep(autoconnect)
else:
return
def disconnect(self):

View File

@ -19,7 +19,7 @@ def normalizeNick(irc, netname, nick, separator="/"):
# Block until we know the IRC network's nick length (after capabilities
# are sent)
log.debug('(%s) normalizeNick: waiting for irc.connected', irc.name)
irc.connected.wait()
irc.connected.wait(3)
orig_nick = nick
protoname = irc.proto.__name__