diff --git a/jmdaemon/jmdaemon/irc.py b/jmdaemon/jmdaemon/irc.py index 16b00fc..c13d4a0 100644 --- a/jmdaemon/jmdaemon/irc.py +++ b/jmdaemon/jmdaemon/irc.py @@ -169,7 +169,11 @@ class txIRC_Client(irc.IRCClient, object): lineRate is a class variable in the superclass used to limit messages / second. heartbeat is what you'd think. """ - lineRate = 0.5 + #In previous implementation, 450 bytes per second over the last 4 seconds + #was used as the rate limiter/throttle parameter. + #Since we still have max_privmsg_len = 450, that corresponds to a lineRate + #value of 1.0 (seconds). Bumped to 1.3 here for breathing room. + lineRate = 1.3 heartbeatinterval = 60 def __init__(self, wrapper): diff --git a/jmdaemon/test/test_irc_messaging.py b/jmdaemon/test/test_irc_messaging.py index cf07a28..6956221 100644 --- a/jmdaemon/test/test_irc_messaging.py +++ b/jmdaemon/test/test_irc_messaging.py @@ -36,6 +36,7 @@ def on_connect(x): print('simulated on-connect') def on_welcome(mc): print('simulated on-welcome') + mc.tx_irc_client.lineRate = 0.2 if mc.nick == "irc_publisher": d = task.deferLater(reactor, 3.0, junk_pubmsgs, mc) d.addCallback(junk_longmsgs) @@ -137,7 +138,7 @@ class TrialIRC(unittest.TestCase): def test_waiter(self): print("test_main()") #reactor.callLater(1.0, junk_messages, self.mcc) - return task.deferLater(reactor, 32, self._called_by_deffered) + return task.deferLater(reactor, 22, self._called_by_deffered) def _called_by_deffered(self): pass