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(tag): retry requests for 429 error #30

Merged
merged 1 commit into from
Sep 15, 2023
Merged

feat(tag): retry requests for 429 error #30

merged 1 commit into from
Sep 15, 2023

Conversation

mure
Copy link
Collaborator

@mure mure commented Sep 15, 2023

Pull Request

🀨 Rationale

https://dev.azure.com/ni/DevCentral/_workitems/edit/2523281

The tag plugin is likely to get throttled when making a lot of history requests.

πŸ‘©β€πŸ’» Implementation

There's a few ways to approach this, but retrying failed requests is the easiest to implement, works even if a user has multiple dashboards open, and can be reused across all our plugins.

The strategy I've applied is to retry a maximum of 3 times with an exponential backoff (1, 2, 4 seconds). The actual delay for each request will be randomized to introduce jitter.

πŸ§ͺ Testing

Unfortunately, the mild amount of refactoring from this change did force us to have to rewrite all the tests a bit. I also added two new tests for the retry behavior.

βœ… Checklist

@mure mure merged commit 48f664c into main Sep 15, 2023
1 check passed
@mure mure deleted the retry-429s branch September 15, 2023 17:22
mure pushed a commit that referenced this pull request Sep 15, 2023
## [3.1.0](v3.0.2...v3.1.0) (2023-09-15)

### Features

* **tag:** retry requests for 429 error ([#30](#30)) ([48f664c](48f664c))
@mure
Copy link
Collaborator Author

mure commented Sep 15, 2023

πŸŽ‰ This PR is included in version 3.1.0 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

@mure mure added the released label Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants