parent
0a1a47e8b0
commit
01634e4b2e
21
build.psm1
21
build.psm1
|
@ -695,7 +695,26 @@ function Restore-PSPackage
|
|||
|
||||
$ProjectDirs | ForEach-Object {
|
||||
Write-Log "Run dotnet restore $_ $RestoreArguments"
|
||||
Start-NativeExecution { dotnet restore $_ $RestoreArguments }
|
||||
$retryCount = 0
|
||||
$maxTries = 5
|
||||
while($retryCount -lt $maxTries)
|
||||
{
|
||||
try
|
||||
{
|
||||
Start-NativeExecution { dotnet restore $_ $RestoreArguments }
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Log "Failed to restore $_, retrying..."
|
||||
$retryCount++
|
||||
if($retryCount -ge $maxTries)
|
||||
{
|
||||
throw
|
||||
}
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue