From 94d669ebec5d9af0ea7464d2818d2af693204635 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 28 May 2022 13:53:05 +0200 Subject: [PATCH] Make the minimum reconnect delay configurable --- src/conf.py | 4 ++++ src/drivers/Socket.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/conf.py b/src/conf.py index b9314c2ff..5d9523a56 100644 --- a/src/conf.py +++ b/src/conf.py @@ -911,6 +911,10 @@ registerGlobalValue(supybot.drivers, 'module', ValidDriverModule('default', _("""Determines what driver module the 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', registry.PositiveFloat(300.0, _("""Determines the maximum time the bot will wait before attempting to reconnect to an IRC server. The bot may, of diff --git a/src/drivers/Socket.py b/src/drivers/Socket.py index 354fc1f7c..d1c46e8af 100644 --- a/src/drivers/Socket.py +++ b/src/drivers/Socket.py @@ -92,7 +92,7 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin): return ret def resetDelay(self): - self.currentDelay = 10.0 + self.currentDelay = conf.supybot.drivers.maxReconnectWait() def _getNextServer(self): oldServer = getattr(self, 'currentServer', None)