summaryrefslogtreecommitdiff
path: root/cli/npm/cache.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-05-01 16:42:05 -0400
committerGitHub <noreply@github.com>2023-05-01 16:42:05 -0400
commit913176313b6869eeb29b8d48e0c8d80227fa6544 (patch)
treecc0128b36ea9b22207a3dd41a401ae4ecd131e74 /cli/npm/cache.rs
parentecc70eb58fd5531f3b93402cf781e93ef2bb4d64 (diff)
perf: lazily create RootCertStore (#18938)
Diffstat (limited to 'cli/npm/cache.rs')
-rw-r--r--cli/npm/cache.rs5
1 files changed, 3 insertions, 2 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 {