Browse Source

slower lineRate in IRC to match previous throttling parameters

master
Adam Gibson 8 years ago
parent
commit
4c5bb8f9f8
No known key found for this signature in database
GPG Key ID: B3AE09F1E9A3197A
  1. 6
      jmdaemon/jmdaemon/irc.py
  2. 3
      jmdaemon/test/test_irc_messaging.py

6
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):

3
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

Loading…
Cancel
Save