make sure we continue with retry loop when we get an error (#7550)
Improve logging
This commit is contained in:
parent
4866b5f326
commit
bfd46b1a3f
|
@ -694,25 +694,28 @@ function Restore-PSPackage
|
|||
}
|
||||
|
||||
$ProjectDirs | ForEach-Object {
|
||||
Write-Log "Run dotnet restore $_ $RestoreArguments"
|
||||
$project = $_
|
||||
Write-Log "Run dotnet restore $project $RestoreArguments"
|
||||
$retryCount = 0
|
||||
$maxTries = 5
|
||||
while($retryCount -lt $maxTries)
|
||||
{
|
||||
try
|
||||
{
|
||||
Start-NativeExecution { dotnet restore $_ $RestoreArguments }
|
||||
Start-NativeExecution { dotnet restore $project $RestoreArguments }
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Log "Failed to restore $_, retrying..."
|
||||
Write-Log "Failed to restore $project, retrying..."
|
||||
$retryCount++
|
||||
if($retryCount -ge $maxTries)
|
||||
{
|
||||
throw
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
Write-Log "Done restoring $project"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue