A platform for community discussion. Free, open, simple.
FIX: verify the exitence of s3_object properly without db name
Vinoth Kannane12ae453e98b
diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rakeindex 186e2e14cfb..59998e93c67 100644--- a/lib/tasks/uploads.rake+++ b/lib/tasks/uploads.rake@@ -395,8 +395,9 @@ def migrate_to_s3etag = Digest::MD5.file(path).hexdigest unless skip_etag_verifykey = file[file.index(prefix)..-1]key.prepend(folder) if bucket_has_folder_path+ original_path = file.sub("uploads/#{db}", "")- if s3_object = s3_objects.find { |obj| file.ends_with?(obj.key) }+ if s3_object = s3_objects.find { |obj| obj.key.ends_with?(original_path) }next if File.size(path) == s3_object.size && (skip_etag_verify || s3_object.etag[etag])end@@ -417,6 +418,8 @@ def migrate_to_s3endend+ etag ||= Digest::MD5.file(path).hexdigest+if dry_runputs "#{file} => #{options[:key]}"synced += 1