diff options
Diffstat (limited to 'cli/npm/resolvers')
-rw-r--r-- | cli/npm/resolvers/common.rs | 16 | ||||
-rw-r--r-- | cli/npm/resolvers/local.rs | 15 |
2 files changed, 4 insertions, 27 deletions
diff --git a/cli/npm/resolvers/common.rs b/cli/npm/resolvers/common.rs index fec96738e..1991b2c72 100644 --- a/cli/npm/resolvers/common.rs +++ b/cli/npm/resolvers/common.rs @@ -20,7 +20,6 @@ use deno_runtime::deno_fs::FileSystem; use deno_runtime::deno_node::NodePermissions; use deno_runtime::deno_node::NodeResolutionMode; -use crate::npm::cache::should_sync_download; use crate::npm::NpmCache; /// Part of the resolution that interacts with the file system. @@ -127,17 +126,10 @@ impl RegistryReadPermissionChecker { /// Caches all the packages in parallel. pub async fn cache_packages( - mut packages: Vec<NpmResolutionPackage>, + packages: Vec<NpmResolutionPackage>, cache: &Arc<NpmCache>, registry_url: &Url, ) -> Result<(), AnyError> { - let sync_download = should_sync_download(); - if sync_download { - // we're running the tests not with --quiet - // and we want the output to be deterministic - packages.sort_by(|a, b| a.id.cmp(&b.id)); - } - let mut handles = Vec::with_capacity(packages.len()); for package in packages { let cache = cache.clone(); @@ -147,11 +139,7 @@ pub async fn cache_packages( .ensure_package(&package.id.nv, &package.dist, ®istry_url) .await }); - if sync_download { - handle.await??; - } else { - handles.push(handle); - } + handles.push(handle); } let results = futures::future::join_all(handles).await; for result in results { diff --git a/cli/npm/resolvers/local.rs b/cli/npm/resolvers/local.rs index f8d7c2848..afa95e756 100644 --- a/cli/npm/resolvers/local.rs +++ b/cli/npm/resolvers/local.rs @@ -42,7 +42,6 @@ use serde::Deserialize; use serde::Serialize; use crate::npm::cache::mixed_case_package_name_encode; -use crate::npm::cache::should_sync_download; use crate::npm::resolution::NpmResolution; use crate::npm::NpmCache; use crate::util::fs::copy_dir_recursive; @@ -300,14 +299,8 @@ async fn sync_resolution_with_fs( // // Copy (hardlink in future) <global_registry_cache>/<package_id>/ to // node_modules/.deno/<package_folder_id_folder_name>/node_modules/<package_name> - let sync_download = should_sync_download(); - let mut package_partitions = + let package_partitions = snapshot.all_system_packages_partitioned(system_info); - if sync_download { - // we're running the tests not with --quiet - // and we want the output to be deterministic - package_partitions.packages.sort_by(|a, b| a.id.cmp(&b.id)); - } let mut handles: Vec<JoinHandle<Result<(), AnyError>>> = Vec::with_capacity(package_partitions.packages.len()); let mut newest_packages_by_name: HashMap<&String, &NpmResolutionPackage> = @@ -363,11 +356,7 @@ async fn sync_resolution_with_fs( drop(pb_guard); // explicit for clarity Ok(()) }); - if sync_download { - handle.await??; - } else { - handles.push(handle); - } + handles.push(handle); } } |