Skip to content

Commit

Permalink
fix(watch): stopping persistent tasks (#9330)
Browse files Browse the repository at this point in the history
### Description

We were accidentally stopping persistent tasks when we shouldn't have
because we were reusing the same stopper.

### Testing Instructions

We need a way to test persistent stuff and also run construction stuff.
  • Loading branch information
NicholasLYang authored Oct 24, 2024
1 parent 2d5200f commit 1b1f98e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion crates/turborepo-lib/src/run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@ impl Run {
}

pub fn create_run_for_non_interruptible_tasks(&self) -> Self {
let mut new_run = self.clone();
let mut new_run = Self {
// ProcessManager is shared via an `Arc`,
// so we want to explicitly recreate it instead of cloning
processes: ProcessManager::new(self.processes.use_pty()),
..self.clone()
};

let new_engine = new_run.engine.create_engine_for_non_interruptible_tasks();
new_run.engine = Arc::new(new_engine);

Expand Down
1 change: 0 additions & 1 deletion crates/turborepo-lib/src/run/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ impl WatchClient {
),
});

// But we still run the regular tasks blocking
let non_persistent_run = self.run.create_run_for_interruptible_tasks();
let ui_sender = self.ui_sender.clone();
Ok(RunHandle {
Expand Down

0 comments on commit 1b1f98e

Please sign in to comment.