@@ -709,14 +709,7 @@ function MSBuild() {
709
709
Write-PipelineSetVariable - Name ' NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS' - Value ' 20'
710
710
}
711
711
712
- if ($ci ) {
713
- $env: NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY = ' true'
714
- $env: NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT = 6
715
- $env: NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS = 1000
716
- Write-PipelineSetVariable - Name ' NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY' - Value ' true'
717
- Write-PipelineSetVariable - Name ' NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT' - Value ' 6'
718
- Write-PipelineSetVariable - Name ' NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS' - Value ' 1000'
719
- }
712
+ Enable-Nuget - EnhancedRetry
720
713
721
714
$toolsetBuildProject = InitializeToolset
722
715
$basePath = Split-Path - parent $toolsetBuildProject
@@ -764,6 +757,8 @@ function MSBuild-Core() {
764
757
}
765
758
}
766
759
760
+ Enable-Nuget - EnhancedRetry
761
+
767
762
$buildTool = InitializeBuildTool
768
763
769
764
$cmdArgs = " $ ( $buildTool.Command ) /m /nologo /clp:Summary /v:$verbosity /nr:$nodeReuse /p:ContinuousIntegrationBuild=$ci "
@@ -904,3 +899,18 @@ function Try-LogClientIpAddress()
904
899
Write-Host " Unable to get this machine's effective IP address for logging: $_ "
905
900
}
906
901
}
902
+
903
+ #
904
+ # If $ci flag is set, turn on (and log that we did) special environment variables for improved Nuget client retry logic.
905
+ #
906
+ function Enable-Nuget-EnhancedRetry () {
907
+ if ($ci ) {
908
+ Write-Host " Setting NUGET enhanced retry environment variables"
909
+ $env: NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY = ' true'
910
+ $env: NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT = 6
911
+ $env: NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS = 1000
912
+ Write-PipelineSetVariable - Name ' NUGET_ENABLE_EXPERIMENTAL_HTTP_RETRY' - Value ' true'
913
+ Write-PipelineSetVariable - Name ' NUGET_EXPERIMENTAL_MAX_NETWORK_TRY_COUNT' - Value ' 6'
914
+ Write-PipelineSetVariable - Name ' NUGET_EXPERIMENTAL_NETWORK_RETRY_DELAY_MILLISECONDS' - Value ' 1000'
915
+ }
916
+ }
0 commit comments