In the tenacity documentation is the retry wait exponential incorrectly documented

825 Views Asked by At

In the link https://tenacity.readthedocs.io/en/latest/ the below example states that the wait between retries will be 2*1 (capped at 10 seconds), but should not this be a linear growth when the multiplier is 1.

@retry(wait=wait_exponential(multiplier=1, min=4, max=10))
def wait_exponential_1():
    print("Wait 2^x * 1 second between each retry starting with 4 seconds, then up to 10 seconds, then 10 seconds afterwards")
    raise Exception
1

There are 1 best solutions below

0
On BEST ANSWER

The formula is 2^x * multiplier and, in this particular example, the multiplier is 1 (which is a bit confusing for an example). Do not mistake the multiplier with the exponent (x): 2^x is still exponentiation.