Made the maxReconnectWait configurable.

This commit is contained in:
Jeremy Fincher 2005-05-19 23:38:13 +00:00
parent d5653077d3
commit 49e74670a4
2 changed files with 6 additions and 2 deletions

View File

@ -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.
###

View File

@ -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