mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
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.
This commit is contained in:
parent
0329bc69da
commit
71ea4ef274
12 changed files with 126 additions and 42 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue