Merge pull request #10601 from demarches-simplifiees/fix-pj-maintenance-tasks
Technique : rattrape les erreurs active storage lors de la création des variants et previews
This commit is contained in:
commit
52d8f8ed00
2 changed files with 2 additions and 2 deletions
|
@ -29,7 +29,7 @@ module Maintenance
|
|||
attachments.each do |attachment|
|
||||
next if !(attachment.previewable? && attachment.representation_required?)
|
||||
attachment.preview(resize_to_limit: [400, 400]).processed unless attachment.preview(resize_to_limit: [400, 400]).image.attached?
|
||||
rescue MiniMagick::Error
|
||||
rescue MiniMagick::Error, ActiveStorage::Error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -32,7 +32,7 @@ module Maintenance
|
|||
if attachment.blob.content_type.in?(RARE_IMAGE_TYPES) && attachment.variant(resize_to_limit: [2000, 2000]).key.nil?
|
||||
attachment.variant(resize_to_limit: [2000, 2000]).processed
|
||||
end
|
||||
rescue MiniMagick::Error
|
||||
rescue MiniMagick::Error, ActiveStorage::Error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue