diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs
index 33e8db19eab..5d7ad8f6124 100644
--- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs
+++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs
@@ -767,8 +767,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
/// True if all feeds are reachable or false otherwise.
private bool CheckSpecifiedFeeds(HashSet feeds)
{
- logger.LogInfo("Checking that NuGet feeds are reachable...");
-
+ // Exclude any feeds that are configured by the corresponding environment variable.
var excludedFeeds = EnvironmentVariables.GetURLs(EnvironmentVariableNames.ExcludedNugetFeedsFromResponsivenessCheck)
.ToHashSet();
@@ -777,9 +776,10 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
logger.LogInfo($"Excluded NuGet feeds from responsiveness check: {string.Join(", ", excludedFeeds.OrderBy(f => f))}");
}
- var (initialTimeout, tryCount) = GetFeedRequestSettings(isFallback: false);
+ var feedsToCheck = feeds.Where(feed => !excludedFeeds.Contains(feed)).ToHashSet();
+ var reachableFeeds = this.GetReachableNuGetFeeds(feedsToCheck, isFallback: false);
+ var allFeedsReachable = reachableFeeds.Count == feedsToCheck.Count;
- var allFeedsReachable = feeds.All(feed => excludedFeeds.Contains(feed) || IsFeedReachable(feed, initialTimeout, tryCount));
if (!allFeedsReachable)
{
logger.LogWarning("Found unreachable NuGet feed in C# analysis with build-mode 'none'. This may cause missing dependencies in the analysis.");