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

feat: add retry-after header support #22

Merged
merged 8 commits into from
Mar 3, 2023

Conversation

nicdard
Copy link
Contributor

@nicdard nicdard commented Feb 13, 2023

Description

  • Extend retries to 429 by default
  • Support parsing of retry-after header and use the time specified there when available instead of the exponential backoff strategy
  • Add tests to cover the new features

Related Issue

Motivation and Context

This feature is used to better handle retries.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@shazron shazron added the enhancement New feature or request label Feb 14, 2023
@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Merging #22 (1b3e820) into master (762fc54) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master       #22   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          113       134   +21     
  Branches        22        30    +8     
=========================================
+ Hits           113       134   +21     
Impacted Files Coverage Δ
src/HttpExponentialBackoff.js 100.00% <100.00%> (ø)
src/utils.js 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@nicdard
Copy link
Contributor Author

nicdard commented Feb 14, 2023

What's the normal workflow? Should I rebase on top of new master or simply update the branch with merge?

@sangeetha5491 sangeetha5491 requested a review from shazron March 2, 2023 08:12
src/utils.js Outdated Show resolved Hide resolved
@sangeetha5491
Copy link
Contributor

The changes look good . Will also wait for @shazron to approve

test/utils.test.js Show resolved Hide resolved
@shazron shazron merged commit 3c998b6 into adobe:master Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants