From 49e74670a47bd4649c99c706c86c7dc01675fb2c Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 19 May 2005 23:38:13 +0000 Subject: [PATCH] Made the maxReconnectWait configurable. --- src/conf.py | 5 +++++ src/drivers/Twisted.py | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/conf.py b/src/conf.py index 287a54738..58e8aad99 100644 --- a/src/conf.py +++ b/src/conf.py @@ -675,6 +675,11 @@ registerGlobalValue(supybot.drivers, 'module', applications. twistedDrivers is very stable and simple, and if you've got Twisted installed, is probably your best bet.""")) +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 + course, reconnect earlier if possible.""")) + ### # supybot.directories, for stuff relating to directories. ### diff --git a/src/drivers/Twisted.py b/src/drivers/Twisted.py index f984906b5..39a4b011d 100644 --- a/src/drivers/Twisted.py +++ b/src/drivers/Twisted.py @@ -108,8 +108,7 @@ def errorMsg(reason): return reason.getErrorMessage() class SupyReconnectingFactory(ReconnectingClientFactory, drivers.ServersMixin): - # XXX Shouldn't the maxDelay be configurable? - maxDelay = 300 + maxDelay = property(lambda self: conf.supybot.drivers.maxReconnectWait()) protocol = SupyIrcProtocol def __init__(self, irc): self.irc = irc