Adding curl retry for external tool downloads (#2552)

* adding retry for flaky downloads

* adding comment

* Update src/Misc/externals.sh

Co-authored-by: Tingluo Huang <tingluohuang@github.com>

---------

Co-authored-by: Tingluo Huang <tingluohuang@github.com>
This commit is contained in:
Maggie Spletzer
2023-04-18 14:31:46 -04:00
committed by GitHub
parent c7629700ad
commit 38ab9dedf4

View File

@@ -60,7 +60,8 @@ function acquireExternalTool() {
# -S Show error. With -s, make curl show errors when they occur
# -L Follow redirects (H)
# -o FILE Write to FILE instead of stdout
curl -fkSL -o "$partial_target" "$download_source" 2>"${download_target}_download.log" || checkRC 'curl'
# --retry 3 Retries transient errors 3 times (timeouts, 5xx)
curl -fkSL --retry 3 -o "$partial_target" "$download_source" 2>"${download_target}_download.log" || checkRC 'curl'
# Move the partial file to the download target.
mv "$partial_target" "$download_target" || checkRC 'mv'