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 retries for failed requests #412

Closed
tverona1 opened this issue Jul 1, 2020 · 2 comments
Closed

Add retries for failed requests #412

tverona1 opened this issue Jul 1, 2020 · 2 comments

Comments

@tverona1
Copy link

tverona1 commented Jul 1, 2020

It would be useful to add retries for failed requests.

Something like: https://github.com/FGRibreau/node-request-retry (for a drop-in replacement to request) or https://github.com/sindresorhus/got#retry (if moving to something other than request going forward).

Thanks!

@s0ph1e
Copy link
Member

s0ph1e commented Jul 5, 2020

Hey @tverona1

Thank you for suggestion 👍
I'm not going to do it right now, but this improvement can be implemented during migration from request to some other library #401

@s0ph1e
Copy link
Member

s0ph1e commented Dec 24, 2021

request was replaced with got in #445 and starting from next version v5 it will be possible to use retries by passing got options, e.g.

const options = {
	urls: [ 'http://example.com/' ],
	directory: testDirname,
	request: {
		throwHttpErrors: true,
		retry: {
			limit: 2,
			methods: ['GET'],
			statusCodes: [500]
		}
	}
};

@s0ph1e s0ph1e closed this as completed Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants