Skip to content

Commit

Permalink
core: Tweak rate limiting to be more effective
Browse files Browse the repository at this point in the history
This doesn't solve the issue, but it should make it slightly less
critical. #952
  • Loading branch information
embolalia committed Jan 31, 2016
1 parent e6d3a2c commit ed5a218
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sopel/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ def say(self, text, recipient, max_messages=1):
elif self.stack[recipient_id]:
elapsed = time.time() - self.stack[recipient_id][-1][0]
if elapsed < 3:
penalty = float(max(0, len(text) - 50)) / 70
wait = 0.7 + penalty
penalty = float(max(0, len(text) - 40)) / 70
wait = 0.8 + penalty
if elapsed < wait:
time.sleep(wait - elapsed)

Expand Down

0 comments on commit ed5a218

Please sign in to comment.