diff options
Diffstat (limited to 'cli/npm')
| -rw-r--r-- | cli/npm/cache.rs | 1 | ||||
| -rw-r--r-- | cli/npm/registry.rs | 5 |
2 files changed, 2 insertions, 4 deletions
diff --git a/cli/npm/cache.rs b/cli/npm/cache.rs index 71a82fd51..a733ecceb 100644 --- a/cli/npm/cache.rs +++ b/cli/npm/cache.rs @@ -204,6 +204,7 @@ impl NpmCache { // if this file exists, then the package didn't successfully extract // the first time, or another process is currently extracting the zip file && !package_folder.join(NPM_PACKAGE_SYNC_LOCK_FILENAME).exists() + && self.cache_setting.should_use_for_npm_package(&id.name) { return Ok(()); } else if self.cache_setting == CacheSetting::Only { diff --git a/cli/npm/registry.rs b/cli/npm/registry.rs index 4fb926287..a0ffd0544 100644 --- a/cli/npm/registry.rs +++ b/cli/npm/registry.rs @@ -105,7 +105,6 @@ pub struct NpmRegistryApi { base_url: Url, cache: NpmCache, mem_cache: Arc<Mutex<HashMap<String, Option<NpmPackageInfo>>>>, - reload: bool, cache_setting: CacheSetting, progress_bar: ProgressBar, } @@ -133,7 +132,6 @@ impl NpmRegistryApi { pub fn new( base_url: Url, cache: NpmCache, - reload: bool, cache_setting: CacheSetting, progress_bar: ProgressBar, ) -> Self { @@ -141,7 +139,6 @@ impl NpmRegistryApi { base_url, cache, mem_cache: Default::default(), - reload, cache_setting, progress_bar, } @@ -171,7 +168,7 @@ impl NpmRegistryApi { Ok(info) } else { let mut maybe_package_info = None; - if !self.reload { + if self.cache_setting.should_use_for_npm_package(name) { // attempt to load from the file cache maybe_package_info = self.load_file_cached_package_info(name); } |
