mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 21:19:41 -06:00
Rescue all errors when backfilling shas for uploads.
This commit is contained in:
parent
90571f0364
commit
f19232646f
@ -71,11 +71,8 @@ task "uploads:backfill_shas" => :environment do
|
|||||||
u.sha1 = Digest::SHA1.file(path).hexdigest
|
u.sha1 = Digest::SHA1.file(path).hexdigest
|
||||||
u.save!
|
u.save!
|
||||||
putc "."
|
putc "."
|
||||||
rescue ActiveRecord::RecordInvalid
|
rescue => e
|
||||||
puts "#{u.extension} is not valid"
|
putc "Skipping #{upload.original_filename} (#{upload.url}) #{e.message}"
|
||||||
putc "X"
|
|
||||||
rescue Errno::ENOENT
|
|
||||||
putc "X"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user