From baf10e314847386e64845cd48b4afd254759b3dd Mon Sep 17 00:00:00 2001 From: Richard Frank Date: Wed, 20 Apr 2016 15:45:18 -0400 Subject: [PATCH] BLD: Don't accept the download if we tried too many times It's likely we have an incomplete file. --- ci/appveyor/install.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ci/appveyor/install.ps1 b/ci/appveyor/install.ps1 index 0b4f0a9a..eb75be14 100644 --- a/ci/appveyor/install.ps1 +++ b/ci/appveyor/install.ps1 @@ -33,12 +33,11 @@ function DownloadMiniconda ($python_version, $platform_suffix) { Start-Sleep 1 } } - if (Test-Path $filepath) { - Write-Host "File saved at" $filepath - } else { + if (!(Test-Path $filepath) -or ($i -ge $retry_attempts)) { # Retry once to get the error message if any at the last try $webclient.DownloadFile($url, $filepath) } + Write-Host "File saved at" $filepath return $filepath }