moritzraho commented on a change in pull request #227:
URL:
https://github.com/apache/openwhisk-client-js/pull/227#discussion_r729009003
##########
File path: lib/client.js
##########
@@ -135,7 +150,21 @@ class Client {
throw new Error(`${messages.INVALID_OPTIONS_ERROR} Missing either api or
apihost parameters.`)
}
- return { apiKey: apiKey, api, apiVersion: apiversion, ignoreCerts:
ignoreCerts, namespace: options.namespace, apigwToken: apigwToken,
apigwSpaceGuid: apigwSpaceGuid, authHandler: options.auth_handler, noUserAgent:
options.noUserAgent, cert: options.cert, key: options.key, proxy, agent }
+ // gather retry options
+ const retry = options.retry
+ if (retry && typeof options.retry !== 'object') {
+ throw new Error(`${messages.INVALID_OPTIONS_ERROR} 'retry' option must
be an object, e.g. '{ retries: 2 }'.`)
+ }
+ if (retry) {
+ // overwrite async-retry defaults, see
https://github.com/vercel/async-retry#api for more details
+ retry.retries = retry.retries || 2
+ retry.factor = retry.factor || 2
+ retry.minTimeout = retry.minTimeout || 100
Review comment:
@selfxp was thinking about the case where openwhisk-js is used from a
web-action action, 1 second min timeout might be too long
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]