fix metrics

migrate
prplV 2025-06-06 09:18:43 -04:00
parent 4133d2f348
commit d4e9a2f875
2 changed files with 13 additions and 5 deletions

View File

@ -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()

View File

@ -246,7 +246,11 @@ pub mod v2 {
self.name
);
if let Err(er) = unfreeze_process(&self.name).await {
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,10 +268,14 @@ pub mod v2 {
info!("{}: New PID - {}", self.name, self.pid);
}
Err(er) => {
if er.to_string().contains("already") {
self.state = ProcessState::Pending;
} else {
error!("Cannot start process {} : {}", self.name, er);
}
}
}
}
(ProcessState::Pending, (false, false)) => {
info!(
"{} process was impermissibly stopped. Starting ...",