Rescue all errors when backfilling shas for uploads.

This commit is contained in:
Guo Xiang Tan 2016-08-23 15:05:37 +08:00
parent 90571f0364
commit f19232646f
1 changed files with 2 additions and 5 deletions

View File

@ -71,11 +71,8 @@ task "uploads:backfill_shas" => :environment do
u.sha1 = Digest::SHA1.file(path).hexdigest
u.save!
putc "."
rescue ActiveRecord::RecordInvalid
puts "#{u.extension} is not valid"
putc "X"
rescue Errno::ENOENT
putc "X"
rescue => e
putc "Skipping #{upload.original_filename} (#{upload.url}) #{e.message}"
end
end
end