diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2023-01-10 15:28:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-10 16:28:10 +0100 |
commit | 71ea4ef2746d7d75623a821d4832d3531a8e1654 (patch) | |
tree | 7d5d9676c5de9b32edcc2aee9a94394e4de2a19f /cli/graph_util.rs | |
parent | 0329bc69dabbcc4d57ff9d34d695ffd4ddb1de4f (diff) |
fix(watch): preserve `ProcState::file_fetcher` between restarts (#15466)
This commit changes "ProcState" to store "file_fetcher" field in an "Arc",
allowing it to be preserved between restarts and thus keeping the state
alive between the restarts. File watchers for "deno test" and "deno bench"
now reset "ProcState" between restarts.
Diffstat (limited to 'cli/graph_util.rs')
-rw-r--r-- | cli/graph_util.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/graph_util.rs b/cli/graph_util.rs index 812701892..35eaae127 100644 --- a/cli/graph_util.rs +++ b/cli/graph_util.rs @@ -72,7 +72,7 @@ pub struct GraphData { impl GraphData { /// Store data from `graph` into `self`. - pub fn add_graph(&mut self, graph: &ModuleGraph, reload: bool) { + pub fn add_graph(&mut self, graph: &ModuleGraph) { for graph_import in &graph.imports { for dep in graph_import.dependencies.values() { for resolved in [&dep.maybe_code, &dep.maybe_type] { @@ -96,7 +96,7 @@ impl GraphData { continue; } - if !reload && self.modules.contains_key(specifier) { + if self.modules.contains_key(specifier) { continue; } @@ -470,7 +470,7 @@ impl GraphData { impl From<&ModuleGraph> for GraphData { fn from(graph: &ModuleGraph) -> Self { let mut graph_data = GraphData::default(); - graph_data.add_graph(graph, false); + graph_data.add_graph(graph); graph_data } } @@ -542,7 +542,7 @@ pub async fn create_graph_and_maybe_check( let check_js = ps.options.check_js(); let mut graph_data = GraphData::default(); - graph_data.add_graph(&graph, false); + graph_data.add_graph(&graph); graph_data .check( &graph.roots, |