-
Notifications
You must be signed in to change notification settings - Fork 370
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
feat: add functionality for passing preconditions at the function level #1993
Conversation
…feeullah/preconditionUpdates
…feeullah/preconditionUpdates
…feeullah/preconditionUpdates
…feeullah/preconditionUpdates
…feeullah/preconditionUpdates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just 2 things
if (err) { | ||
if ([408, 429, 500, 502, 503, 504].indexOf(err.code!) !== -1) { | ||
return true; | ||
} | ||
|
||
if (typeof err.code === 'string') { | ||
const reason = (err.code as string).toLowerCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cast here shouldn’t be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without this line it throws errors: Property 'toLowerCase' does not exist on type 'never'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments, IIUC you're extending existing options with PreconditionOptions
for all operations.
…#2020) * tests: remove callback waterfall from make bucket private system test * cleaner implementation
…pis/nodejs-storage into shaffeeullah/preconditionUpdates
…pis/nodejs-storage into shaffeeullah/preconditionUpdates
@frankyn can you please take another look at this when you have a sec? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had one more question, otherwise LGTM.
@@ -875,6 +875,7 @@ export class Util { | |||
|
|||
if (typeof reqOpts.maxRetries === 'number') { | |||
options.retries = reqOpts.maxRetries; | |||
options.noResponseRetries = reqOpts.maxRetries; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naive question, shouldn't this value come from maxRetryValue
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reqOpts.maxRetries
overrides maxRetryValue. It's used in cases where we need to override the user (like forcing no retries because of idempotency)
Adds functionality to pass preconditions at the function level. Also includes a few fixes such as:
Internal ticket: b/239141167