diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-04-12 08:36:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-12 08:36:11 -0400 |
commit | 0e3f62d4446ae7b9a64dacf7befcaecede118222 (patch) | |
tree | fc1cbbbb294e61bb61e8d8ed89fa50cc9e9efa34 /cli/npm/resolution.rs | |
parent | 806671af3345f403d122911d8a3f09a2994bb8c0 (diff) |
fix(npm): cache bust npm specifiers more aggressively (#18636)
Part 1: #18622
Part 2: This PR
Closes #16901
---------
Co-authored-by: Luca Casonato <hello@lcas.dev>
Diffstat (limited to 'cli/npm/resolution.rs')
-rw-r--r-- | cli/npm/resolution.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/npm/resolution.rs b/cli/npm/resolution.rs index d012b4f08..7d1619b94 100644 --- a/cli/npm/resolution.rs +++ b/cli/npm/resolution.rs @@ -27,7 +27,7 @@ use deno_semver::npm::NpmPackageReqReference; use crate::args::Lockfile; -use super::registry::NpmRegistry; +use super::registry::CliNpmRegistryApi; /// Handles updating and storing npm resolution in memory where the underlying /// snapshot can be updated concurrently. Additionally handles updating the lockfile @@ -38,7 +38,7 @@ use super::registry::NpmRegistry; pub struct NpmResolution(Arc<NpmResolutionInner>); struct NpmResolutionInner { - api: NpmRegistry, + api: CliNpmRegistryApi, snapshot: RwLock<NpmResolutionSnapshot>, update_queue: TaskQueue, maybe_lockfile: Option<Arc<Mutex<Lockfile>>>, @@ -55,7 +55,7 @@ impl std::fmt::Debug for NpmResolution { impl NpmResolution { pub fn new( - api: NpmRegistry, + api: CliNpmRegistryApi, initial_snapshot: Option<NpmResolutionSnapshot>, maybe_lockfile: Option<Arc<Mutex<Lockfile>>>, ) -> Self { @@ -247,7 +247,7 @@ impl NpmResolution { } async fn add_package_reqs_to_snapshot( - api: &NpmRegistry, + api: &CliNpmRegistryApi, // todo(18079): it should be possible to pass &[NpmPackageReq] in here // and avoid all these clones, but the LSP complains because of its // `Send` requirement |