mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 13:57:16 +00:00
fix(tauri-cli): remove busy-looping
This commit is contained in:
parent
aada6a4422
commit
ff3c01e5b0
@ -21,7 +21,6 @@ pub use rust::{MobileOptions, Options, Rust as AppInterface, WatcherOptions};
|
||||
|
||||
pub trait DevProcess {
|
||||
fn kill(&self) -> std::io::Result<()>;
|
||||
fn try_wait(&self) -> std::io::Result<Option<ExitStatus>>;
|
||||
#[allow(unused)]
|
||||
fn wait(&self) -> std::io::Result<ExitStatus>;
|
||||
#[allow(unused)]
|
||||
|
||||
@ -584,11 +584,7 @@ impl Rust {
|
||||
|
||||
// wait for the process to exit
|
||||
// note that on mobile, kill() already waits for the process to exit (duct implementation)
|
||||
loop {
|
||||
if !matches!(child.try_wait(), Ok(None)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
let _ = child.wait();
|
||||
child = run(self, config)?;
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,10 +33,6 @@ impl DevProcess for DevChild {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn try_wait(&self) -> std::io::Result<Option<ExitStatus>> {
|
||||
self.dev_child.try_wait()
|
||||
}
|
||||
|
||||
fn wait(&self) -> std::io::Result<ExitStatus> {
|
||||
self.dev_child.wait()
|
||||
}
|
||||
|
||||
@ -77,10 +77,6 @@ impl DevProcess for DevChild {
|
||||
}
|
||||
}
|
||||
|
||||
fn try_wait(&self) -> std::io::Result<Option<ExitStatus>> {
|
||||
self.child.try_wait().map(|res| res.map(|o| o.status))
|
||||
}
|
||||
|
||||
fn wait(&self) -> std::io::Result<ExitStatus> {
|
||||
self.child.wait().map(|o| o.status)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user