Skip to content
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

Closed
wants to merge 1 commit into
base: release-3.7.x
from

Conversation

Projects
None yet
2 participants
@ddfreyne
Copy link
Member

ddfreyne commented Feb 21, 2015

This is continued off #480.

This is quite tricky to write tests for. Not sure how to handle that.

@ddfreyne

This comment has been minimized.

Copy link
Member Author

ddfreyne commented Mar 7, 2015

CC @nanoc/contributors — would like a +1

@mpapis

This comment has been minimized.

Copy link
Member

mpapis commented Mar 7, 2015

yes looks good 👍, I guess my only remark is that the run grows quite big, but it's not related to this PR

@ddfreyne ddfreyne added status:wip 🔧 and removed to review labels Apr 18, 2015

@ddfreyne

This comment has been minimized.

Copy link
Member Author

ddfreyne commented Apr 18, 2015

Will look into adding some tests for this. (Will be hard, I guess!)

@ddfreyne ddfreyne modified the milestone: 3.7.6 Apr 19, 2015

local_etag = calc_local_etag(file_path)
remote_etag = etags[key]
next if remote_etag && remote_etag == local_etag

This comment has been minimized.

@mpapis

mpapis Apr 19, 2015

Member

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

This comment has been minimized.

@ddfreyne

ddfreyne May 31, 2015

Author Member

Thanks, updated! (see #552—not this PR)

@mpapis

This comment has been minimized.

Copy link
Member

mpapis commented Apr 19, 2015

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 upload - this also solves problem of growing run - and add attr_accessor :directory, :etags, :keys_to_destroy - this way you can check your custom directory and list of etags without actually connecting to aws.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.