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

Add support for retrying failed requests #642

Open
dcu opened this issue Aug 19, 2023 · 1 comment
Open

Add support for retrying failed requests #642

dcu opened this issue Aug 19, 2023 · 1 comment

Comments

@dcu
Copy link

dcu commented Aug 19, 2023

What would you like to be added?

429 and 5XX errors should be retried

Why is this needed?

it improves the UX otherwise the dev would have to check the response and implement retries every time this library is used

Anything else we need to know?

@dcu
Copy link
Author

dcu commented Aug 19, 2023

a way to fix this is using https://github.com/hashicorp/go-retryablehttp like this:

	retryClient := retryablehttp.NewClient()
	retryClient.RetryMax = 15
	standardClient := retryClient.StandardClient()

	tp := jira.BasicAuthTransport{
		Username:  username,
		APIToken:  password,
		Transport: standardClient.Transport,
	}

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

No branches or pull requests

1 participant