Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>2020-12-24 01:48:17 +0300
committerGitHub <noreply@github.com>2020-12-24 01:48:17 +0300
commit5e0f955c77143af36f19b4d093672f2ce72bd65d (patch)
treefd47108c727ae72a5f15ffeeb67fa93a6fb2942b /eng/common/tools.ps1
parentdadeb83b63a9979828677caa96d8ff4871980607 (diff)
[master] Update dependencies from dotnet/runtime-assets dotnet/llvm-project dotnet/icu dotnet/arcade (#46321)
[master] Update dependencies from dotnet/runtime-assets dotnet/llvm-project dotnet/icu dotnet/arcade - Merge branch 'master' into darc-master-00529095-a8ce-4967-9456-ad78bb3e877c
Diffstat (limited to 'eng/common/tools.ps1')
-rw-r--r--eng/common/tools.ps125
1 files changed, 20 insertions, 5 deletions
diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1
index bc8b66e2943..ce280eb95b1 100644
--- a/eng/common/tools.ps1
+++ b/eng/common/tools.ps1
@@ -439,11 +439,26 @@ function LocateVisualStudio([object]$vsRequirements = $null){
if (!(Test-Path $vsWhereExe)) {
Create-Directory $vsWhereDir
Write-Host 'Downloading vswhere'
- try {
- Invoke-WebRequest "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/vswhere/$vswhereVersion/vswhere.exe" -OutFile $vswhereExe
- }
- catch {
- Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
+ $maxRetries = 5
+ $retries = 1
+
+ while($true) {
+ try {
+ Invoke-WebRequest "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/vswhere/$vswhereVersion/vswhere.exe" -OutFile $vswhereExe
+ break
+ }
+ catch{
+ Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_
+ }
+
+ if (++$retries -le $maxRetries) {
+ $delayInSeconds = [math]::Pow(2, $retries) - 1 # Exponential backoff
+ Write-Host "Retrying. Waiting for $delayInSeconds seconds before next attempt ($retries of $maxRetries)."
+ Start-Sleep -Seconds $delayInSeconds
+ }
+ else {
+ Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Unable to download file in $maxRetries attempts."
+ }
}
}