refactor: use deno_cache_dir crate (#20092)

Uses https://github.com/denoland/deno_cache/pull/26
This commit is contained in:
David Sherret 2023-08-08 10:23:02 -04:00 committed by GitHub
parent a037ed77a2
commit 05f838a57c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 221 additions and 1946 deletions

View file

@ -422,7 +422,10 @@ pub struct ModuleRegistry {
impl ModuleRegistry {
pub fn new(location: PathBuf, http_client: Arc<HttpClient>) -> Self {
// the http cache should always be the global one for registry completions
let http_cache = Arc::new(GlobalHttpCache::new(location));
let http_cache = Arc::new(GlobalHttpCache::new(
location,
crate::cache::RealDenoCacheEnv,
));
let mut file_fetcher = FileFetcher::new(
http_cache.clone(),
CacheSetting::RespectHeaders,