diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2018-05-10 11:35:38 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-10 11:35:38 -0500 |
| commit | 694ba9c04b8ab1d8a76e2549b213428f093bb359 (patch) | |
| tree | 262911f5e848b72735c4086a0d95bc00e3da0bf2 /src/ci/shared.sh | |
| parent | 74e731fcb07de3527c84e9a30821034784aa40cd (diff) | |
| parent | 7def3f0c82a95ee9147c969e94665418bf77468c (diff) | |
| download | rust-694ba9c04b8ab1d8a76e2549b213428f093bb359.tar.gz rust-694ba9c04b8ab1d8a76e2549b213428f093bb359.zip | |
Rollup merge of #50606 - kennytm:retry-docker-cache, r=alexcrichton
Retry when downloading the Docker cache. As a safety measure, prevent spuriously needing to rebuild the docker image in case the network was reset while downloading. Also, adjusted the retry function to insert a sleep between retries, because retrying immediately will often just hit the same issue.
Diffstat (limited to 'src/ci/shared.sh')
| -rw-r--r-- | src/ci/shared.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ci/shared.sh b/src/ci/shared.sh index 4a08683e3ee..bb6945f0fd6 100644 --- a/src/ci/shared.sh +++ b/src/ci/shared.sh @@ -21,11 +21,12 @@ function retry { while true; do "$@" && break || { if [[ $n -lt $max ]]; then + sleep $n # don't retry immediately ((n++)) echo "Command failed. Attempt $n/$max:" else echo "The command has failed after $n attempts." - exit 1 + return 1 fi } done |
