Skip to content

Commit 0e9c684

Browse files
authored
Fix specific-version async dependency error handling path
1 parent efb000d commit 0e9c684

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/code/FindHelper.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,12 +1282,10 @@ private PSResourceInfo FindDependencyWithSpecificVersion(
12821282
debugMsgs.Enqueue("In FindHelper::FindDependencyWithSpecificVersion()");
12831283

12841284

1285-
// See if the network call we're making is already cached, if not, call FindNameAsync() and cache results
1285+
// Call FindVersionAsync() for dependency with specific version.
12861286
string key = $"{dep.Name}|{dep.VersionRange.MaxVersion.ToString()}|{_type}";
1287-
debugMsgs.Enqueue("Checking if network call is cached.");
1288-
response = _cachedNetworkCalls.GetOrAdd(key, _ => currentServer.FindVersionAsync(dep.Name, dep.VersionRange.MaxVersion.ToString(), _type, errorMsgs, warningMsgs, debugMsgs, verboseMsgs));
1289-
1290-
responses = response.GetAwaiter().GetResult();
1287+
responses = currentServer.FindVersionAsync(dep.Name, dep.VersionRange.MaxVersion.ToString(), _type, errorMsgs, warningMsgs, debugMsgs, verboseMsgs).GetAwaiter().GetResult();
1288+
errorMsgs.TryPeek(out errRecord);
12911289

12921290
// Error handling and Convert to PSResource object
12931291
if (errRecord != null)

0 commit comments

Comments
 (0)