diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-05-16 00:09:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 07:09:35 +0000 |
commit | 88983fb3eb5a085f7d358a7a98d5c738a21b5d27 (patch) | |
tree | d4d83c5bd668edc25d30616fd4a3decc1cea3fb9 /cli/main.rs | |
parent | bba553bea5938932518dc6382e464968ce8374b4 (diff) |
fix(node): seperate worker module cache (#23634)
Construct a new module graph container for workers instead of sharing it
with the main worker.
Fixes #17248
Fixes #23461
---------
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'cli/main.rs')
-rw-r--r-- | cli/main.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cli/main.rs b/cli/main.rs index 4f866ee21..099bf060c 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -8,6 +8,7 @@ mod emit; mod errors; mod factory; mod file_fetcher; +mod graph_container; mod graph_util; mod http_util; mod js; @@ -30,6 +31,7 @@ use crate::args::flags_from_vec; use crate::args::DenoSubcommand; use crate::args::Flags; use crate::args::DENO_FUTURE; +use crate::graph_container::ModuleGraphContainer; use crate::util::display; use crate::util::v8::get_v8_flags_from_env; use crate::util::v8::init_v8_flags; @@ -112,18 +114,19 @@ async fn run_subcommand(flags: Flags) -> Result<i32, AnyError> { }), DenoSubcommand::Cache(cache_flags) => spawn_subcommand(async move { let factory = CliFactory::from_flags(flags)?; - let module_load_preparer = factory.module_load_preparer().await?; let emitter = factory.emitter()?; - let graph_container = factory.graph_container(); - module_load_preparer + let main_graph_container = + factory.main_module_graph_container().await?; + main_graph_container .load_and_type_check_files(&cache_flags.files) .await?; - emitter.cache_module_emits(&graph_container.graph()) + emitter.cache_module_emits(&main_graph_container.graph()) }), DenoSubcommand::Check(check_flags) => spawn_subcommand(async move { let factory = CliFactory::from_flags(flags)?; - let module_load_preparer = factory.module_load_preparer().await?; - module_load_preparer + let main_graph_container = + factory.main_module_graph_container().await?; + main_graph_container .load_and_type_check_files(&check_flags.files) .await }), |