mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-03-06 06:20:43 +01:00
Don't throttle when delay is exactly equal
If throttle time is set to 0.0 (e.g. in tests) and the reported time since last dequeue is also 0.0 (maybe because the timer resolution is too low), takeMsg would throttle. This would make tests fail because they expect messages immediately. This issue was observed on Windows 10 20H2 with both a mingw-w64 Python v3.8.9 from MSYS2 and several version of official Python v3.x. Confirmed at least as far back as aa98d987a7f4db6e57b5b8489ca714d98c6b8452. Since it's a non-integer comparison, the change shouldn't have any observable effect in normal operation.
This commit is contained in:
parent
dce969e4b9
commit
151fcf8caf
@ -1430,7 +1430,7 @@ class Irc(IrcCommandDispatcher, log.Firewalled):
|
||||
if self.fastqueue:
|
||||
msg = self.fastqueue.dequeue()
|
||||
elif self.queue:
|
||||
if now-self.lastTake <= conf.supybot.protocols.irc.throttleTime():
|
||||
if now-self.lastTake < conf.supybot.protocols.irc.throttleTime():
|
||||
log.debug('Irc.takeMsg throttling.')
|
||||
else:
|
||||
self.lastTake = now
|
||||
|
Loading…
x
Reference in New Issue
Block a user