Add exponential backoff of login attempts.
This commit is contained in:
parent
066b3ed8f0
commit
2dcdd7ba5b
5 changed files with 46 additions and 1 deletions
5
util/backoff.py
Normal file
5
util/backoff.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
def exponential_backoff(attempts, scaling_factor, base):
|
||||
backoff = 5 * (pow(2, attempts) - 1)
|
||||
backoff_time = backoff * scaling_factor
|
||||
retry_at = backoff_time/10 + base
|
||||
return retry_at
|
Reference in a new issue