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:
Eric Leroy-Terquem 2024-07-11 09:12:32 +00:00 committed by GitHub
commit 52d8f8ed00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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