fix(maintenance task): catch active storage errors

This commit is contained in:
Eric Leroy-Terquem 2024-07-11 10:37:00 +02:00
parent 6dc8496d3d
commit ad7f01f97b
No known key found for this signature in database
GPG key ID: 53D8FAECEF207605
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