prc state check logic fixed without code repeating
parent
c50c444f21
commit
721fa6c758
|
|
@ -48,22 +48,20 @@ pub mod v2 {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
match self.state {
|
if self.negative_events.len() == 0 {
|
||||||
ProcessState::Holding => {
|
match self.state {
|
||||||
if self.negative_events.len() == 0 {
|
ProcessState::Holding => {
|
||||||
info!("No negative dependecies events on {} process. Unfreezing ...", self.name);
|
info!("No negative dependecies events on {} process. Unfreezing ...", self.name);
|
||||||
unfreeze_process(self.name).await;
|
unfreeze_process(self.name).await;
|
||||||
}
|
},
|
||||||
},
|
ProcessState::Stopped => {
|
||||||
ProcessState::Stopped => {
|
|
||||||
if self.negative_events.len() == 0 {
|
|
||||||
info!("No negative dependecies events on {} process. Starting ...", self.name);
|
info!("No negative dependecies events on {} process. Starting ...", self.name);
|
||||||
if let Err(_) = start_process(self.name, &self.obj.path).await {
|
if let Err(_) = start_process(self.name, &self.obj.path).await {
|
||||||
error!("Cannot start process {} due to {}", self.name, "system unrecognized error");
|
error!("Cannot start process {} due to {}", self.name, "system unrecognized error");
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
_ => {},
|
||||||
_ => {},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue