Add timeout log to run_command
This commit is contained in:
parent
88cd3a29dc
commit
e76206817d
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ where
|
||||||
std::thread::Builder::new()
|
std::thread::Builder::new()
|
||||||
.name("command-execution-thread".to_string())
|
.name("command-execution-thread".to_string())
|
||||||
.spawn(move || {
|
.spawn(move || {
|
||||||
log::debug!("Running command from widget: {}", cmd);
|
log::debug!("Running command from widget [timeout: {}ms]: {}", timeout.as_millis(), cmd);
|
||||||
let child = Command::new("/bin/sh").arg("-c").arg(&cmd).spawn();
|
let child = Command::new("/bin/sh").arg("-c").arg(&cmd).spawn();
|
||||||
match child {
|
match child {
|
||||||
Ok(mut child) => match child.wait_timeout(timeout) {
|
Ok(mut child) => match child.wait_timeout(timeout) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue