mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
refactor: rewrite HTTP cache for file fetcher (#4030)
This commit is contained in:
parent
046bbb2691
commit
852823fa50
10 changed files with 428 additions and 600 deletions
|
@ -10,8 +10,6 @@ use std::path::PathBuf;
|
|||
pub struct DenoDir {
|
||||
// Example: /Users/rld/.deno/
|
||||
pub root: PathBuf,
|
||||
/// Used by SourceFileFetcher to cache remote modules.
|
||||
pub deps_cache: DiskCache,
|
||||
/// Used by TsCompiler to cache compiler output.
|
||||
pub gen_cache: DiskCache,
|
||||
}
|
||||
|
@ -29,12 +27,10 @@ impl DenoDir {
|
|||
.unwrap_or(fallback);
|
||||
|
||||
let root: PathBuf = custom_root.unwrap_or(default);
|
||||
let deps_path = root.join("deps");
|
||||
let gen_path = root.join("gen");
|
||||
|
||||
let deno_dir = Self {
|
||||
root,
|
||||
deps_cache: DiskCache::new(&deps_path),
|
||||
gen_cache: DiskCache::new(&gen_path),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue