mirror of
https://git.wownero.com/wownero/tippero.git
synced 2024-08-15 00:33:14 +00:00
Some more tweaking of the flood protection code
This commit is contained in:
parent
abb67ef06f
commit
ce3c69b339
1 changed files with 7 additions and 4 deletions
|
@ -23,7 +23,7 @@ irc_line_delay = 0
|
|||
irc = None
|
||||
sslirc = None
|
||||
irc_password = ""
|
||||
irc_min_send_delay = 0.01 # seconds
|
||||
irc_min_send_delay = 0.05 # seconds
|
||||
irc_max_send_delay = 5 # seconds
|
||||
|
||||
last_ping_time = time.time()
|
||||
|
@ -48,9 +48,12 @@ def SendIRC(msg):
|
|||
if current_send_delay > irc_max_send_delay:
|
||||
current_send_delay = irc_max_send_delay
|
||||
else:
|
||||
current_send_delay = current_send_delay / 1.5
|
||||
if current_send_delay < irc_min_send_delay:
|
||||
current_send_delay = irc_min_send_delay
|
||||
while dt > current_send_delay * 1.5:
|
||||
dt = dt - current_send_delay
|
||||
current_send_delay = current_send_delay / 1.5
|
||||
if current_send_delay < irc_min_send_delay:
|
||||
current_send_delay = irc_min_send_delay
|
||||
break
|
||||
|
||||
log_IRCSEND(msg)
|
||||
irc_send(msg + '\r\n')
|
||||
|
|
Loading…
Reference in a new issue