summaryrefslogtreecommitdiff
path: root/cli/npm
diff options
context:
space:
mode:
Diffstat (limited to 'cli/npm')
-rw-r--r--cli/npm/cache.rs5
-rw-r--r--cli/npm/registry.rs4
2 files changed, 5 insertions, 4 deletions
diff --git a/cli/npm/cache.rs b/cli/npm/cache.rs
index 0d88109de..cda40fd17 100644
--- a/cli/npm/cache.rs
+++ b/cli/npm/cache.rs
@@ -4,6 +4,7 @@ use std::collections::HashSet;
use std::fs;
use std::path::Path;
use std::path::PathBuf;
+use std::sync::Arc;
use deno_ast::ModuleSpecifier;
use deno_core::anyhow::bail;
@@ -295,7 +296,7 @@ impl ReadonlyNpmCache {
pub struct NpmCache {
readonly: ReadonlyNpmCache,
cache_setting: CacheSetting,
- http_client: HttpClient,
+ http_client: Arc<HttpClient>,
progress_bar: ProgressBar,
/// ensures a package is only downloaded once per run
previously_reloaded_packages: Mutex<HashSet<NpmPackageNv>>,
@@ -305,7 +306,7 @@ impl NpmCache {
pub fn new(
cache_dir_path: PathBuf,
cache_setting: CacheSetting,
- http_client: HttpClient,
+ http_client: Arc<HttpClient>,
progress_bar: ProgressBar,
) -> Self {
Self {
diff --git a/cli/npm/registry.rs b/cli/npm/registry.rs
index ef050a734..40d7f6219 100644
--- a/cli/npm/registry.rs
+++ b/cli/npm/registry.rs
@@ -63,7 +63,7 @@ impl CliNpmRegistryApi {
pub fn new(
base_url: Url,
cache: Arc<NpmCache>,
- http_client: HttpClient,
+ http_client: Arc<HttpClient>,
progress_bar: ProgressBar,
) -> Self {
Self(Some(Arc::new(CliNpmRegistryApiInner {
@@ -172,7 +172,7 @@ struct CliNpmRegistryApiInner {
force_reload_flag: AtomicFlag,
mem_cache: Mutex<HashMap<String, CacheItem>>,
previously_reloaded_packages: Mutex<HashSet<String>>,
- http_client: HttpClient,
+ http_client: Arc<HttpClient>,
progress_bar: ProgressBar,
}