Polly-Contrib / Polly.Contrib.WaitAndRetry

Polly.Contrib.WaitAndRetry is an extension library for Polly containing helper methods for a variety of wait-and-retry strategies.
Other
133 stars 12 forks source link

Error in the exponential backoff docs? #33

Open kinetiq opened 1 year ago

kinetiq commented 1 year ago

In the readme here: https://github.com/Polly-Contrib/Polly.Contrib.WaitAndRetry/blob/master/README.md?plain=1

I found this:

var delay = Backoff.ExponentialBackoff(TimeSpan.FromMilliseconds(100), retryCount: 5, factor: 4);

It goes on to say:

The upper for this retry with a growth factor of four is 25,600ms. Care and a calculator should be used when changing the factor.

I eventually built this out in a spreadsheet because care a calculator wasn't working. ;) Shouldn't the sequence be:

1: 100ms 2: 1600ms 3: 8100ms 4: 25600ms 5: 62500ms *(TL;DR: 100ms 5 ^ 4)**

...Making the upper 62,500ms? Please let me know if this is calculated differently.

In any event, keep up the great work!