-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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(storage/transfermanager): add SkipIfExists option #10893
Conversation
t.Errorf("result.Err: %v", got.Err) | ||
} | ||
|
||
if strings.EqualFold(got.Object, "dir/objA") { |
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.
This only checks dir/objA
, do you want to check the other included objects?
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.
Added.
|
||
// Now attempt to download the entire directory. | ||
// The existing files should be skipped. | ||
callbacks := make(chan bool) |
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.
It would help to clarify that you're checking that SkipIfExists() should not attempt downloading included files from previous directory download;
// In lex order we have:
// "dir/nested/again/obj1", -- included
// "dir/nested/objA", -- skipped
// "dir/file" -- included
// "dir/objA", -- skipped
// "dir/objB", -- skipped
// "dir/objC", -- included
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 added a comment here and put those objects in a variable - does that seem sufficient here?
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.
Yes, thank you;
case <-done: | ||
break | ||
case <-callbacks: | ||
gotCallbacks++ |
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.
For my learning, gotCallbacks
is synchronized; so the directory download which uses a mutex could be rewritten this way. Is that correct?
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.
Correct. I re-wrote that logic, PTAL.
No description provided.