@@ -708,6 +708,8 @@ public IEnumerable<PSResourceInfo> FindByTag(
708708 private IEnumerable < PSResourceInfo > SearchByNames ( ServerApiCall currentServer , ResponseUtil currentResponseUtil , PSRepositoryInfo repository , bool shouldReportErrorForEachRepo )
709709 {
710710 ErrorRecord errRecord = null ;
711+ ConcurrentQueue < ErrorRecord > errorMsgs = new ConcurrentQueue < ErrorRecord > ( ) ;
712+ ConcurrentQueue < string > debugMsgs = new ConcurrentQueue < string > ( ) ;
711713 List < PSResourceInfo > parentPkgs = new List < PSResourceInfo > ( ) ;
712714 string tagsAsString = String . Empty ;
713715 bool isV2Resource = currentResponseUtil is V2ResponseUtil ;
@@ -904,11 +906,13 @@ private IEnumerable<PSResourceInfo> SearchByNames(ServerApiCall currentServer, R
904906 FindResults responses = null ;
905907 if ( _tag . Length == 0 )
906908 {
909+
910+
907911 ConcurrentDictionary < string , Task < FindResults > > cachedNetworkCalls = new ConcurrentDictionary < string , Task < FindResults > > ( ) ;
908912 Task < FindResults > response = null ;
909913 if ( currentServer . Repository . ApiVersion == PSRepositoryInfo . APIVersion . V2 ) {
910914 string key = $ "{ pkgName } |{ _nugetVersion . ToNormalizedString ( ) } |{ _type } ";
911- response = cachedNetworkCalls . GetOrAdd ( key , _ => currentServer . FindVersionAsync ( pkgName , _nugetVersion . ToNormalizedString ( ) , _type ) ) ;
915+ response = cachedNetworkCalls . GetOrAdd ( key , _ => currentServer . FindVersionAsync ( pkgName , _nugetVersion . ToNormalizedString ( ) , _type , errorMsgs , debugMsgs ) ) ;
912916
913917 responses = response . GetAwaiter ( ) . GetResult ( ) ;
914918
@@ -993,7 +997,7 @@ private IEnumerable<PSResourceInfo> SearchByNames(ServerApiCall currentServer, R
993997 Task < FindResults > response = null ;
994998 if ( currentServer . Repository . ApiVersion == PSRepositoryInfo . APIVersion . V2 ) {
995999 string key = $ "{ pkgName } |{ _versionRange . ToString ( ) } |{ _type } ";
996- response = cachedNetworkCalls . GetOrAdd ( key , _ => currentServer . FindVersionGlobbingAsync ( pkgName , _versionRange , _prerelease , _type , getOnlyLatest : false ) ) ;
1000+ response = cachedNetworkCalls . GetOrAdd ( key , _ => currentServer . FindVersionGlobbingAsync ( pkgName , _versionRange , _prerelease , _type , getOnlyLatest : false , errorMsgs , debugMsgs ) ) ;
9971001
9981002 responses = response . GetAwaiter ( ) . GetResult ( ) ;
9991003 }
@@ -1250,7 +1254,7 @@ private void FindDependencyPackageVersion(
12501254 else
12511255 {
12521256 // Find this version from the server
1253- depPkg = FindDependencyWithLowerBound ( dep , currentServer , currentResponseUtil , currentPkg , repository , errorMsgs , debugMsgs ) ;
1257+ depPkg = FindDependencyWithLowerBound ( dep , currentServer , currentResponseUtil , currentPkg , repository , errorMsgs , verboseMsgs ) ;
12541258 }
12551259 }
12561260 else if ( dep . VersionRange . HasLowerBound && dep . VersionRange . MinVersion . Equals ( dep . VersionRange . MaxVersion ) )
@@ -1267,7 +1271,7 @@ private void FindDependencyPackageVersion(
12671271 }
12681272 else
12691273 {
1270- depPkg = FindDependencyWithSpecificVersion ( dep , currentServer , currentResponseUtil , currentPkg , repository , errorMsgs , debugMsgs ) ;
1274+ depPkg = FindDependencyWithSpecificVersion ( dep , currentServer , currentResponseUtil , currentPkg , repository , errorMsgs , verboseMsgs , warningMsgs ) ;
12711275 }
12721276 }
12731277 else
@@ -1283,7 +1287,7 @@ private void FindDependencyPackageVersion(
12831287 }
12841288 else
12851289 {
1286- depPkg = FindDependencyWithUpperBound ( dep , currentServer , currentResponseUtil , currentPkg , repository , errorMsgs , debugMsgs ) ;
1290+ depPkg = FindDependencyWithUpperBound ( dep , currentServer , currentResponseUtil , currentPkg , repository , errorMsgs , verboseMsgs ) ;
12871291 }
12881292 }
12891293 }
@@ -1309,7 +1313,7 @@ private PSResourceInfo FindDependencyWithSpecificVersion(
13091313 // See if the network call we're making is already cached, if not, call FindNameAsync() and cache results
13101314 string key = $ "{ dep . Name } |{ dep . VersionRange . MaxVersion . ToString ( ) } |{ _type } ";
13111315 verboseMsgs . Enqueue ( "Checking if network call is cached." ) ;
1312- response = _cachedNetworkCalls . GetOrAdd ( key , _ => currentServer . FindVersionAsync ( dep . Name , dep . VersionRange . MaxVersion . ToString ( ) , _type ) ) ;
1316+ response = _cachedNetworkCalls . GetOrAdd ( key , _ => currentServer . FindVersionAsync ( dep . Name , dep . VersionRange . MaxVersion . ToString ( ) , _type , errorMsgs , verboseMsgs ) ) ;
13131317
13141318 responses = response . GetAwaiter ( ) . GetResult ( ) ;
13151319 }
@@ -1382,7 +1386,7 @@ private PSResourceInfo FindDependencyWithLowerBound(
13821386 // See if the network call we're making is already cached, if not, call FindNameAsync() and cache results
13831387 string key = $ "{ dep . Name } |*|{ _type } ";
13841388 verboseMsgs . Enqueue ( "Checking if network call is cached." ) ;
1385- response = _cachedNetworkCalls . GetOrAdd ( key , _ => currentServer . FindNameAsync ( dep . Name , includePrerelease : true , _type ) ) ;
1389+ response = _cachedNetworkCalls . GetOrAdd ( key , _ => currentServer . FindNameAsync ( dep . Name , includePrerelease : true , _type , errorMsgs , verboseMsgs ) ) ;
13861390
13871391 responses = response . GetAwaiter ( ) . GetResult ( ) ;
13881392 }
@@ -1456,7 +1460,7 @@ private PSResourceInfo FindDependencyWithUpperBound(
14561460 // See if the network call we're making is already caced, if not, call FindNameAsync() and cache results
14571461 string key = $ "{ dep . Name } |{ dep . VersionRange . MaxVersion . ToString ( ) } |{ _type } ";
14581462 verboseMsgs . Enqueue ( "Checking if network call is cached." ) ;
1459- response = cachedNetworkCalls . GetOrAdd ( key , _ => currentServer . FindVersionGlobbingAsync ( dep . Name , dep . VersionRange , includePrerelease : true , ResourceType . None , getOnlyLatest : true ) ) ;
1463+ response = cachedNetworkCalls . GetOrAdd ( key , _ => currentServer . FindVersionGlobbingAsync ( dep . Name , dep . VersionRange , includePrerelease : true , ResourceType . None , getOnlyLatest : true , errorMsgs , verboseMsgs ) ) ;
14601464
14611465 responses = response . GetAwaiter ( ) . GetResult ( ) ;
14621466
0 commit comments