Skip to content

feat: add retry logic #27

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

Merged
merged 1 commit into from
Jul 27, 2023
Merged

feat: add retry logic #27

merged 1 commit into from
Jul 27, 2023

Conversation

eduardoboucas
Copy link
Member

Which problem is this pull request solving?

Adds a retry mechanism, similar to the one we have in the JavaScript API client.

@eduardoboucas eduardoboucas requested a review from a team as a code owner July 27, 2023 15:23
@netlify
Copy link

netlify bot commented Jul 27, 2023

Deploy Preview for blobs-js ready!

Name Link
🔨 Latest commit 70d4bba
🔍 Latest deploy log https://app.netlify.com/sites/blobs-js/deploys/64c28c0778e3070008294d5e
😎 Deploy Preview https://deploy-preview-27--blobs-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jul 27, 2023
const res = await fetcher(url, options)

if (attemptsLeft > 0 && (res.status === 429 || res.status >= 500)) {
const delay = getDelay(res.headers.get(RATE_LIMIT_HEADER))
Copy link
Contributor

Choose a reason for hiding this comment

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

this is cool!

@eduardoboucas eduardoboucas merged commit c824f0d into main Jul 27, 2023
@eduardoboucas eduardoboucas deleted the feat/retry-logic branch October 24, 2023 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants