softonic / axios-retry

Axios plugin that intercepts failed requests and retries them whenever possible
Other
1.9k stars 167 forks source link

exponentialDelay seems to use a constant interval #106

Closed dinvlad closed 4 years ago

dinvlad commented 4 years ago

Hi all,

It seems that exponentialDelay retries after the same amount of delay every time. E.g. my retry logs show that the requests are retried each ~20+/-1 sec, starting with retryCount: 0 all the way to retryCount: 4. I have set

axiosRetry(axios, {
  retries: 5,
  retryDelay: exponentialDelay,
  retryCondition: err => {
    console.error(err.config['axios-retry']);
    return isNetworkOrIdempotentRequestError(err);
  },
});

I'm using axios 0.19.2 and axios-retry 3.1.2.

Thanks!

dinvlad commented 4 years ago

Seems that this is caused by https://github.com/softonic/axios-retry/issues/87, since even for retryCount: 4, the result is on the order of a few 100 ms..