Make the minimum reconnect delay configurable

This commit is contained in:
Valentin Lorentz 2022-05-28 13:53:05 +02:00
parent 32198d42c2
commit 94d669ebec
2 changed files with 5 additions and 1 deletions

View File

@ -911,6 +911,10 @@ registerGlobalValue(supybot.drivers, 'module',
ValidDriverModule('default', _("""Determines what driver module the ValidDriverModule('default', _("""Determines what driver module the
bot will use. Current, the only (and default) driver is Socket."""))) bot will use. Current, the only (and default) driver is Socket.""")))
registerGlobalValue(supybot.drivers, 'minReconnectWait',
registry.PositiveFloat(10.0, _("""Determines the minimum time the bot will
wait before attempting to reconnect to an IRC server.""")))
registerGlobalValue(supybot.drivers, 'maxReconnectWait', registerGlobalValue(supybot.drivers, 'maxReconnectWait',
registry.PositiveFloat(300.0, _("""Determines the maximum time the bot will registry.PositiveFloat(300.0, _("""Determines the maximum time the bot will
wait before attempting to reconnect to an IRC server. The bot may, of wait before attempting to reconnect to an IRC server. The bot may, of

View File

@ -92,7 +92,7 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
return ret return ret
def resetDelay(self): def resetDelay(self):
self.currentDelay = 10.0 self.currentDelay = conf.supybot.drivers.maxReconnectWait()
def _getNextServer(self): def _getNextServer(self):
oldServer = getattr(self, 'currentServer', None) oldServer = getattr(self, 'currentServer', None)