@@ -1175,7 +1175,7 @@ internal IEnumerable<PSResourceInfo> FindDependencyPackages(ServerApiCall curren
11751175 // Method 2
11761176 internal void FindDependencyPackagesHelper ( ServerApiCall currentServer , ResponseUtil currentResponseUtil , PSResourceInfo currentPkg , PSRepositoryInfo repository )
11771177 {
1178- List < ErrorRecord > errors = new List < ErrorRecord > ( ) ;
1178+ ConcurrentBag < ErrorRecord > errors = new ConcurrentBag < ErrorRecord > ( ) ;
11791179 if ( currentPkg . Dependencies . Length > 0 )
11801180 {
11811181 // If finding more than 5 packages, do so concurrently
@@ -1205,23 +1205,23 @@ internal void FindDependencyPackagesHelper(ServerApiCall currentServer, Response
12051205 }
12061206
12071207 // Method 3
1208- private void FindDependencyPackageVersion ( Dependency dep , ServerApiCall currentServer , ResponseUtil currentResponseUtil , PSResourceInfo currentPkg , PSRepositoryInfo repository , List < ErrorRecord > errors )
1208+ private void FindDependencyPackageVersion ( Dependency dep , ServerApiCall currentServer , ResponseUtil currentResponseUtil , PSResourceInfo currentPkg , PSRepositoryInfo repository , ConcurrentBag < ErrorRecord > errors )
12091209 {
12101210 PSResourceInfo depPkg = null ;
12111211
12121212 if ( dep . VersionRange . Equals ( VersionRange . All ) || ! dep . VersionRange . HasUpperBound )
12131213 {
1214- // Case 1: No upper bound, eg: "*" or "(1.0.0, )"
1215- // Check if the latest version is cached
1216- if ( _knownLatestPkgVersion . TryGetValue ( dep . Name , out PSResourceInfo cachedDepPkg ) )
1217- {
1218- depPkg = cachedDepPkg ;
1219- }
1220- else
1221- {
1222- // Find this version from the server
1223- depPkg = FindDependencyWithLowerBound ( dep , currentServer , currentResponseUtil , currentPkg , repository , errors ) ;
1224- }
1214+ // Case 1: No upper bound, eg: "*" or "(1.0.0, )"
1215+ // Check if the latest version is cached
1216+ if ( _knownLatestPkgVersion . TryGetValue ( dep . Name , out PSResourceInfo cachedDepPkg ) )
1217+ {
1218+ depPkg = cachedDepPkg ;
1219+ }
1220+ else
1221+ {
1222+ // Find this version from the server
1223+ depPkg = FindDependencyWithLowerBound ( dep , currentServer , currentResponseUtil , currentPkg , repository , errors ) ;
1224+ }
12251225 }
12261226 else if ( dep . VersionRange . HasLowerBound && dep . VersionRange . MinVersion . Equals ( dep . VersionRange . MaxVersion ) )
12271227 {
@@ -1257,7 +1257,7 @@ private void FindDependencyPackageVersion(Dependency dep, ServerApiCall currentS
12571257 }
12581258
12591259 // Method 4
1260- private PSResourceInfo FindDependencyWithSpecificVersion ( Dependency dep , ServerApiCall currentServer , ResponseUtil currentResponseUtil , PSResourceInfo currentPkg , PSRepositoryInfo repository , List < ErrorRecord > errors )
1260+ private PSResourceInfo FindDependencyWithSpecificVersion ( Dependency dep , ServerApiCall currentServer , ResponseUtil currentResponseUtil , PSResourceInfo currentPkg , PSRepositoryInfo repository , ConcurrentBag < ErrorRecord > errors )
12611261 {
12621262 PSResourceInfo depPkg = null ;
12631263 ErrorRecord errRecord = null ;
@@ -1320,7 +1320,7 @@ private PSResourceInfo FindDependencyWithSpecificVersion(Dependency dep, ServerA
13201320 }
13211321
13221322 // Method 5
1323- private PSResourceInfo FindDependencyWithLowerBound ( Dependency dep , ServerApiCall currentServer , ResponseUtil currentResponseUtil , PSResourceInfo currentPkg , PSRepositoryInfo repository , List < ErrorRecord > errors )
1323+ private PSResourceInfo FindDependencyWithLowerBound ( Dependency dep , ServerApiCall currentServer , ResponseUtil currentResponseUtil , PSResourceInfo currentPkg , PSRepositoryInfo repository , ConcurrentBag < ErrorRecord > errors )
13241324 {
13251325 PSResourceInfo depPkg = null ;
13261326 FindResults responses = null ;
@@ -1383,7 +1383,7 @@ private PSResourceInfo FindDependencyWithLowerBound(Dependency dep, ServerApiCal
13831383 }
13841384
13851385 // Method 6
1386- private PSResourceInfo FindDependencyWithUpperBound ( Dependency dep , ServerApiCall currentServer , ResponseUtil currentResponseUtil , PSResourceInfo currentPkg , PSRepositoryInfo repository , List < ErrorRecord > errors )
1386+ private PSResourceInfo FindDependencyWithUpperBound ( Dependency dep , ServerApiCall currentServer , ResponseUtil currentResponseUtil , PSResourceInfo currentPkg , PSRepositoryInfo repository , ConcurrentBag < ErrorRecord > errors )
13871387 {
13881388 PSResourceInfo depPkg = null ;
13891389 ErrorRecord errRecord = null ;
0 commit comments