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

Change args on Retry? #50

Open
mfinegold-cambia opened this issue Jul 20, 2021 · 0 comments
Open

Change args on Retry? #50

mfinegold-cambia opened this issue Jul 20, 2021 · 0 comments

Comments

@mfinegold-cambia
Copy link

We are calling a service that requires a slightly different Authorization token on each retry request ( HMAC token ). I'd like to use the args option to call a function to regenerate the token on each retry ( the function attachAuthHeader(requestConfig, log) below ), but when I look at all the retry requests going down the wire, bb retry still seems to be holding onto the original token, so doesn't look like my function is getting invoked on each retry. Is there some other way to do this?

Code looks like :

return bbRetry(request-promise, {
interval: 1000,
backoff: 2,
max_tries: 2,
predicate: err => {
const predResult = defaultPredicate(err, log) && (_.isFunction(condition) ? condition(err) : true);
return predResult;
},
throw_original: true,
context,
args: [attachAuthHeader(requestConfig, log)]
});
}

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