Merge pull request #10984 from demarches-simplifiees/fix-image-processor-job-errors

Technique : gestion des cas d'erreurs de ImageProcessorJob
This commit is contained in:
LeSim 2024-10-30 14:43:43 +00:00 committed by GitHub
commit 0e589fc7ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View file

@ -18,8 +18,9 @@ module AttachmentImageProcessorConcern
def process_image
return if blob.nil?
return if blob.attachments.size > 1
return if blob.attachments.size != 1
return if blob.attachments.last.record_type == "Export"
return if !blob.content_type.in?(PROCESSABLE_TYPES)
ImageProcessorJob.perform_later(blob)
end