FIX: correctly use timeouts in FileHelper and FinalDestination (#12921)

Previous refactors have lost usage of read_timeout in `FileHelper.download` and `FinalDestination` was incorrectly using `Net::HTTP.start` by setting `open_timeout` in the block instead of directly during the invocation.

Couldn't figure how to write a good test for this without slowing the spec.
This commit is contained in:
Joffrey JAFFEUX
2021-05-03 09:21:11 +02:00
committed by GitHub
parent f1e74c89a1
commit 64dda7112d
2 changed files with 4 additions and 5 deletions

View File

@ -49,7 +49,8 @@ class FileHelper
max_redirects: follow_redirect ? 5 : 0,
skip_rate_limit: skip_rate_limit,
verbose: verbose,
validate_uri: validate_uri
validate_uri: validate_uri,
timeout: read_timeout
)
fd.get do |response, chunk, uri|