-
Notifications
You must be signed in to change notification settings - Fork 249
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
command/sync: update default strategy, update tests #369
Conversation
* Rename Strategy to SyncStrategy * Update SizeAndModificationStrategy to match awscli's SizeAndLastModifiedSync
* and simplify file name differences between source and destination
command/sync_strategy.go
Outdated
// time: src <= dst size: src == dst should sync: no | ||
type SizeAndModificationStrategy struct{} | ||
|
||
func (sm *SizeAndModificationStrategy) Compare(srcObj, dstObj *storage.Object) error { |
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.
On my first read of the code, I think that if Compare()
returns nil
, it means "these files are same, no need to sync". But it works just the opposite. Maybe we could consider renaming it or working the other way around.
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.
Agree, I've renamed it to ShouldSync
.
Co-authored-by: Aykut Farsak <aykutfarsak@gmail.com>
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.
LGTM
Co-authored-by: H. İbrahim Güngör <igungor@gmail.com>
Co-authored-by: H. İbrahim Güngör <igungor@gmail.com>
Here's a summary of changes;
SizeAndModificationStrategy
) to matchawscli
's default strategy (SizeAndLastModifiedSync
).sync
tests by mocking time to control remote object's upload time.gofakes3
server.go fmt
wanted to update build tags;