Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axios client initial #10

Merged
merged 2 commits into from
Apr 21, 2022
Merged

Axios client initial #10

merged 2 commits into from
Apr 21, 2022

Conversation

jimmythomson
Copy link
Member

No description provided.

@jimmythomson jimmythomson merged commit 495c578 into main Apr 21, 2022
if (retryCount === 0) {
return 0
}
return delayMs * 2 ** (retryCount - 1)
Copy link

@jameswiltshire jameswiltshire Apr 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have jitter support in here too - here's snippet adding that (arguably should be +/- to normalise the jitter distribution both sides of retryDelay - but this is fine to add the randomness)
const delay = RETRY_DELAY_MS * 2 ** (retryCount - 1) + _.random(0, RETRY_JITTER_MS) // exponential backoff with jitter

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an open issue in the axios-retry package to add this there directly 😄
JustinBeckwith/retry-axios#172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants