Merge pull request #10247 from colinux/fix-export-memory-leak

Tech: fix memory leak pendant le téléchargement des PJ des exports
This commit is contained in:
mfo 2024-04-02 08:14:28 +00:00 committed by GitHub
commit e40ef51f61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,7 +14,7 @@ module DownloadManager
def download_all
hydra = Typhoeus::Hydra.new(max_concurrency: DOWNLOAD_MAX_PARALLEL)
attachments.map do |attachment, path|
attachments.each do |attachment, path|
begin
download_one(attachment: attachment,
path_in_download_dir: path,
@ -23,7 +23,10 @@ module DownloadManager
on_error.call(attachment, path, e)
end
end
hydra.run
GC.start
end
# can't be used with typhoeus, otherwise block is closed before the request is run by hydra