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:
commit
e40ef51f61
1 changed files with 4 additions and 1 deletions
|
@ -14,7 +14,7 @@ module DownloadManager
|
||||||
def download_all
|
def download_all
|
||||||
hydra = Typhoeus::Hydra.new(max_concurrency: DOWNLOAD_MAX_PARALLEL)
|
hydra = Typhoeus::Hydra.new(max_concurrency: DOWNLOAD_MAX_PARALLEL)
|
||||||
|
|
||||||
attachments.map do |attachment, path|
|
attachments.each do |attachment, path|
|
||||||
begin
|
begin
|
||||||
download_one(attachment: attachment,
|
download_one(attachment: attachment,
|
||||||
path_in_download_dir: path,
|
path_in_download_dir: path,
|
||||||
|
@ -23,7 +23,10 @@ module DownloadManager
|
||||||
on_error.call(attachment, path, e)
|
on_error.call(attachment, path, e)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
hydra.run
|
hydra.run
|
||||||
|
|
||||||
|
GC.start
|
||||||
end
|
end
|
||||||
|
|
||||||
# can't be used with typhoeus, otherwise block is closed before the request is run by hydra
|
# can't be used with typhoeus, otherwise block is closed before the request is run by hydra
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue