From e66d3c2c2e287879a757e12943a6d240981cb9e8 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 14 Sep 2023 13:51:28 -0400 Subject: refactor: remove `DENO_UNSTABLE_NPM_SYNC_DOWNLOAD` and custom sync functionality (#20504) https://github.com/denoland/deno/pull/20488 enables us to remove this functionality. This is better because our test suite is now not testing a separate code path. --- cli/npm/resolvers/common.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'cli/npm/resolvers/common.rs') 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, + packages: Vec, cache: &Arc, 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 { -- cgit v1.2.3