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
Do not upload files with identical etags #536
Conversation
f7788c7
to
63a4f6b
Compare
63a4f6b
to
f41dfdd
Compare
CC @nanoc/contributors — would like a +1 |
yes looks good 👍, I guess my only remark is that the |
Will look into adding some tests for this. (Will be hard, I guess!) |
local_etag = calc_local_etag(file_path) | ||
remote_etag = etags[key] | ||
next if remote_etag && remote_etag == local_etag | ||
|
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.
avoid calculating local hash if remote is not available:
remote_etag = etags[key]
if remote_etag
local_etag = calc_local_etag(file_path)
next if remote_etag == local_etag
end
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.
Thanks, updated! (see #552—not this PR)
to simplify testing you could extract https://github.com/nanoc/nanoc/blob/aws-deploy-md5-v2/lib/nanoc/extra/deployers/fog.rb#L68-L86 to separate method |
This is continued off #480.
This is quite tricky to write tests for. Not sure how to handle that.