summaryrefslogtreecommitdiff
path: root/cli/npm/managed/resolvers/common.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-06-03 17:17:08 -0400
committerGitHub <noreply@github.com>2024-06-03 21:17:08 +0000
commit3341c50b6ae676cdc8f7b1c44221aa633f2bde68 (patch)
treee051e384d722403ea0a04402679a358ef61002dc /cli/npm/managed/resolvers/common.rs
parent72088f2f52d65b2948155a11e7b56722bf6c10f9 (diff)
refactor: don't share `reqwest::HttpClient` across tokio runtimes (#24092)
This also fixes several issues where we weren't properly creating http clients with the user's settings.
Diffstat (limited to 'cli/npm/managed/resolvers/common.rs')
-rw-r--r--cli/npm/managed/resolvers/common.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/cli/npm/managed/resolvers/common.rs b/cli/npm/managed/resolvers/common.rs
index 2d540accd..4cdad1f99 100644
--- a/cli/npm/managed/resolvers/common.rs
+++ b/cli/npm/managed/resolvers/common.rs
@@ -21,7 +21,6 @@ use deno_runtime::deno_fs::FileSystem;
use deno_runtime::deno_node::NodePermissions;
use deno_runtime::deno_node::NodeResolutionMode;
-use crate::http_util::HttpClient;
use crate::npm::managed::cache::TarballCache;
/// Part of the resolution that interacts with the file system.
@@ -50,10 +49,7 @@ pub trait NpmPackageFsResolver: Send + Sync {
specifier: &ModuleSpecifier,
) -> Result<Option<NpmPackageCacheFolderId>, AnyError>;
- async fn cache_packages(
- &self,
- http_client: &Arc<HttpClient>,
- ) -> Result<(), AnyError>;
+ async fn cache_packages(&self) -> Result<(), AnyError>;
fn ensure_read_permission(
&self,
@@ -131,13 +127,12 @@ impl RegistryReadPermissionChecker {
pub async fn cache_packages(
packages: Vec<NpmResolutionPackage>,
tarball_cache: &Arc<TarballCache>,
- http_client: &Arc<HttpClient>,
) -> Result<(), AnyError> {
let mut futures_unordered = futures::stream::FuturesUnordered::new();
for package in packages {
futures_unordered.push(async move {
tarball_cache
- .ensure_package(&package.id.nv, &package.dist, http_client)
+ .ensure_package(&package.id.nv, &package.dist)
.await
});
}