A platform for community discussion. Free, open, simple.
DEV: add option to skip etag verification on 'migrate_to_s3' rake task
Vinoth Kannan9a9a06e34bd1
diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rakeindex 4d7eec0dc6f..186e2e14cfb 100644--- a/lib/tasks/uploads.rake+++ b/lib/tasks/uploads.rake@@ -388,15 +388,16 @@ def migrate_to_s3synced = 0failed = []+ skip_etag_verify = ENV["SKIP_ETAG_VERIFY"].present?local_files.each do |file|path = File.join("public", file)name = File.basename(path)- etag = Digest::MD5.file(path).hexdigest+ etag = Digest::MD5.file(path).hexdigest unless skip_etag_verifykey = file[file.index(prefix)..-1]key.prepend(folder) if bucket_has_folder_pathif s3_object = s3_objects.find { |obj| file.ends_with?(obj.key) }- next if File.size(path) == s3_object.size && s3_object.etag[etag]+ next if File.size(path) == s3_object.size && (skip_etag_verify || s3_object.etag[etag])endoptions = {