Merge pull request #9552 from demarches-simplifiees/US/fix-export-with-file-bigger-than-4Go

correctif(export): lorsqu'un export .zip fait plus de 4Go, le fait del'assigner via file.attach(blob) declenche soit un identify soit un virus scanner qui par la suite le vide sur le bucket
This commit is contained in:
mfo 2023-10-03 13:40:12 +00:00 committed by GitHub
commit 98d483ec32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View file

@ -52,7 +52,7 @@ class Export < ApplicationRecord
def compute def compute
load_snapshot! load_snapshot!
file.attach(blob) file.attach(blob.signed_id) # attaching a blob directly might run identify/virus scanner and wipe it
end end
def since def since

View file

@ -14,12 +14,7 @@ class ArchiveUploader
end end
archive.reload archive.reload
uploaded_blob.reload uploaded_blob.reload
ActiveStorage::Attachment.create( archive.file.attach(uploaded_blob.signed_id) # attaching a blob directly might run identify/virus scanner and wipe it
name: 'file',
record_type: 'Archive',
record_id: archive.id,
blob_id: uploaded_blob.id
)
end end
def blob def blob