mirror of
https://github.com/actions/runner.git
synced 2025-12-13 00:36:29 +00:00
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:
@@ -60,7 +60,8 @@ function acquireExternalTool() {
|
|||||||
# -S Show error. With -s, make curl show errors when they occur
|
# -S Show error. With -s, make curl show errors when they occur
|
||||||
# -L Follow redirects (H)
|
# -L Follow redirects (H)
|
||||||
# -o FILE Write to FILE instead of stdout
|
# -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.
|
# Move the partial file to the download target.
|
||||||
mv "$partial_target" "$download_target" || checkRC 'mv'
|
mv "$partial_target" "$download_target" || checkRC 'mv'
|
||||||
|
|||||||
Reference in New Issue
Block a user