summaryrefslogtreecommitdiff
path: root/cli/lsp/cache.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-11-28 17:28:54 -0500
committerGitHub <noreply@github.com>2022-11-28 17:28:54 -0500
commit2d4c46c975eb916dc622cc729a1a8d397582a76f (patch)
tree445e819117acd2f94ffc9d7da7ed8e3e604435d0 /cli/lsp/cache.rs
parentf526513d74d34ac254aa40ef9b73238cb21c395b (diff)
refactor: create util folder, move nap_sym to napi/sym, move http_cache to cache folder (#16857)
Diffstat (limited to 'cli/lsp/cache.rs')
-rw-r--r--cli/lsp/cache.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/cli/lsp/cache.rs b/cli/lsp/cache.rs
index c4512a803..7f7f69871 100644
--- a/cli/lsp/cache.rs
+++ b/cli/lsp/cache.rs
@@ -1,6 +1,7 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
-use crate::http_cache;
+use crate::cache::CachedUrlMetadata;
+use crate::cache::HttpCache;
use deno_core::parking_lot::Mutex;
use deno_core::ModuleSpecifier;
@@ -49,14 +50,14 @@ struct Metadata {
#[derive(Debug, Default, Clone)]
pub struct CacheMetadata {
- cache: http_cache::HttpCache,
+ cache: HttpCache,
metadata: Arc<Mutex<HashMap<ModuleSpecifier, Metadata>>>,
}
impl CacheMetadata {
pub fn new(location: &Path) -> Self {
Self {
- cache: http_cache::HttpCache::new(location),
+ cache: HttpCache::new(location),
metadata: Default::default(),
}
}
@@ -87,8 +88,7 @@ impl CacheMetadata {
return None;
}
let cache_filename = self.cache.get_cache_filename(specifier)?;
- let specifier_metadata =
- http_cache::Metadata::read(&cache_filename).ok()?;
+ let specifier_metadata = CachedUrlMetadata::read(&cache_filename).ok()?;
let values = Arc::new(parse_metadata(&specifier_metadata.headers));
let version = calculate_fs_version(&cache_filename);
let mut metadata_map = self.metadata.lock();
@@ -98,7 +98,7 @@ impl CacheMetadata {
}
pub fn set_location(&mut self, location: &Path) {
- self.cache = http_cache::HttpCache::new(location);
+ self.cache = HttpCache::new(location);
self.metadata.lock().clear();
}
}