summaryrefslogtreecommitdiff
path: root/cli/npm/resolvers
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-10-17 12:27:31 -0400
committerGitHub <noreply@github.com>2022-10-17 12:27:31 -0400
commit9df8d9d83140beb24a53b0ac52b1eaf2ea34c095 (patch)
tree3d170572b4ef2a7414db57bc223ef364fc7c0b0e /cli/npm/resolvers
parent60dd84a5a042fdb706d3160d1f4a1deeeeec9889 (diff)
perf(npm): parallelize caching of npm specifier package infos (#16323)
Diffstat (limited to 'cli/npm/resolvers')
-rw-r--r--cli/npm/resolvers/common.rs7
-rw-r--r--cli/npm/resolvers/local.rs2
2 files changed, 2 insertions, 7 deletions
diff --git a/cli/npm/resolvers/common.rs b/cli/npm/resolvers/common.rs
index 7769d2322..b91deae9e 100644
--- a/cli/npm/resolvers/common.rs
+++ b/cli/npm/resolvers/common.rs
@@ -10,6 +10,7 @@ use deno_core::futures;
use deno_core::futures::future::BoxFuture;
use deno_core::url::Url;
+use crate::npm::cache::should_sync_download;
use crate::npm::resolution::NpmResolutionSnapshot;
use crate::npm::NpmCache;
use crate::npm::NpmPackageReq;
@@ -79,12 +80,6 @@ pub async fn cache_packages(
Ok(())
}
-/// For some of the tests, we want downloading of packages
-/// to be deterministic so that the output is always the same
-pub fn should_sync_download() -> bool {
- std::env::var("DENO_UNSTABLE_NPM_SYNC_DOWNLOAD") == Ok("1".to_string())
-}
-
pub fn ensure_registry_read_permission(
registry_path: &Path,
path: &Path,
diff --git a/cli/npm/resolvers/local.rs b/cli/npm/resolvers/local.rs
index 10ac8abfa..cd79320b7 100644
--- a/cli/npm/resolvers/local.rs
+++ b/cli/npm/resolvers/local.rs
@@ -20,9 +20,9 @@ use deno_runtime::deno_core::futures;
use tokio::task::JoinHandle;
use crate::fs_util;
+use crate::npm::cache::should_sync_download;
use crate::npm::resolution::NpmResolution;
use crate::npm::resolution::NpmResolutionSnapshot;
-use crate::npm::resolvers::common::should_sync_download;
use crate::npm::NpmCache;
use crate::npm::NpmPackageId;
use crate::npm::NpmPackageReq;