-
Notifications
You must be signed in to change notification settings - Fork 61
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
onRetryAttempt is not awaited / custom back off strategy #452
Comments
Bascially it would be just here: Line 73 in bf6afeb
to chagne this line to: const backoff = config.backoffHandler && config.backoffHandler(err) || new Promise(resolve => {
setTimeout(resolve, delay);
}); and backoffHandler is an optional function that returns a Promise |
@simllll thank you for the bug report. |
@simllll would this allow for utilizing an exponential backoff retry strategy? |
Yes, in this case you can do whatever you want to do... Including exponential back off |
@simllll switched to Would you be interested in submitting a patch for this functionality? |
Even though in the documentation it's stated that onRetryAttempt can return a promise,
the promise is not awaited:
see
gaxios/src/common.ts
Line 147 in bf6afeb
and
gaxios/src/retry.ts
Line 79 in bf6afeb
My challenge is to build a custom retry handler, which checks for retry-after headers and so on..
I see that adding await would maybe change some behaviour for end-users.. so I would instead vote for a property that allows to override the default expoenitial back off handler? Would that be an option? I can prepare a PR in this case.
The text was updated successfully, but these errors were encountered: