diff --git a/app/tasks/maintenance/create_previews_for_pj_of_latest_dossiers_task.rb b/app/tasks/maintenance/create_previews_for_pj_of_latest_dossiers_task.rb index 75d086737..1c2378340 100644 --- a/app/tasks/maintenance/create_previews_for_pj_of_latest_dossiers_task.rb +++ b/app/tasks/maintenance/create_previews_for_pj_of_latest_dossiers_task.rb @@ -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 diff --git a/app/tasks/maintenance/create_variants_for_pj_of_latest_dossiers_task.rb b/app/tasks/maintenance/create_variants_for_pj_of_latest_dossiers_task.rb index 4a8c41578..2b44d9ea6 100644 --- a/app/tasks/maintenance/create_variants_for_pj_of_latest_dossiers_task.rb +++ b/app/tasks/maintenance/create_variants_for_pj_of_latest_dossiers_task.rb @@ -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