mirror of https://github.com/fail2ban/fail2ban
small optimization
parent
9bdc4be6cc
commit
343ccd7e8a
|
@ -332,11 +332,9 @@ class Utils():
|
||||||
timeout_expr = lambda: time.time() > time0
|
timeout_expr = lambda: time.time() > time0
|
||||||
else:
|
else:
|
||||||
timeout_expr = timeout
|
timeout_expr = timeout
|
||||||
if not interval:
|
|
||||||
interval = Utils.DEFAULT_SLEEP_INTERVAL
|
|
||||||
if timeout_expr():
|
if timeout_expr():
|
||||||
break
|
break
|
||||||
stm = min(stm + interval, Utils.DEFAULT_SLEEP_TIME)
|
stm = min(stm + (interval or Utils.DEFAULT_SLEEP_INTERVAL), Utils.DEFAULT_SLEEP_TIME)
|
||||||
time.sleep(stm)
|
time.sleep(stm)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue