mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-24 03:33:10 +01:00
Irc: require autoconnect value to be >= 1
This prevents sending a flood of connects whenever a server is unreachable.
This commit is contained in:
parent
1c8ee5d84b
commit
4e2876104f
@ -170,10 +170,11 @@ class Irc():
|
||||
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:
|
||||
if autoconnect is not None and autoconnect >= 1:
|
||||
log.info('(%s) Going to auto-reconnect in %s seconds.', self.name, autoconnect)
|
||||
time.sleep(autoconnect)
|
||||
else:
|
||||
log.info('(%s) Stopping connect loop (autoconnect value %r is < 1).', self.name, autoconnect)
|
||||
return
|
||||
|
||||
def callCommand(self, source, text):
|
||||
|
@ -74,7 +74,7 @@ servers:
|
||||
# (omitting the .py extension).
|
||||
protocol: "inspircd"
|
||||
|
||||
# Sets autoconnect delay - comment this out or set the value negative to disable autoconnect entirely.
|
||||
# Sets autoconnect delay - comment this out or set the value below 1 to disable autoconnect entirely.
|
||||
autoconnect: 5
|
||||
|
||||
# Sets ping frequency (i.e. how long we should wait between sending pings to our uplink).
|
||||
|
Loading…
Reference in New Issue
Block a user