From d4e9a2f875c155be6cf50d0c73a7cfb6392d6f8d Mon Sep 17 00:00:00 2001 From: prplV Date: Fri, 6 Jun 2025 09:18:43 -0400 Subject: [PATCH] fix metrics --- noxis-rs/src/utils/metrics.rs | 6 +++--- noxis-rs/src/utils/prcs.rs | 12 ++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/noxis-rs/src/utils/metrics.rs b/noxis-rs/src/utils/metrics.rs index 9147938..5463986 100644 --- a/noxis-rs/src/utils/metrics.rs +++ b/noxis-rs/src/utils/metrics.rs @@ -529,9 +529,9 @@ impl ProcessExtended { Some(duration) => { format!("{}:{}:{}:{}", duration.num_days(), - duration.num_hours(), - duration.num_minutes(), - duration.num_seconds() + duration.num_hours() % 24, + duration.num_minutes() % 60, + duration.num_seconds() % 60 ) }, None => String::new() diff --git a/noxis-rs/src/utils/prcs.rs b/noxis-rs/src/utils/prcs.rs index ec47883..d6daf6e 100644 --- a/noxis-rs/src/utils/prcs.rs +++ b/noxis-rs/src/utils/prcs.rs @@ -246,7 +246,11 @@ pub mod v2 { self.name ); if let Err(er) = unfreeze_process(&self.name).await { - error!("Cannot unfreeze process {} : {}", self.name, er); + if er.to_string().contains("already") { + self.state = ProcessState::Pending; + } else { + error!("Cannot unfreeze process {} : {}", self.name, er); + } } else { self.state = ProcessState::Pending; info!("Process {} was unfreezed", &self.name); @@ -264,7 +268,11 @@ pub mod v2 { info!("{}: New PID - {}", self.name, self.pid); } Err(er) => { - error!("Cannot start process {} : {}", self.name, er); + if er.to_string().contains("already") { + self.state = ProcessState::Pending; + } else { + error!("Cannot start process {} : {}", self.name, er); + } } } }