|
|
|
@ -42,8 +42,7 @@ fn restart_app(proc: Proc) -> Result<Proc> {
|
|
|
|
|
match Proc::start(app) {
|
|
|
|
|
Ok(p) => Ok(p),
|
|
|
|
|
Err(e) => {
|
|
|
|
|
error!("error restarting {}", name);
|
|
|
|
|
error!("{:?}", e);
|
|
|
|
|
error!("[{}] error restarting: {:?}", name, e);
|
|
|
|
|
Err(e)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -65,7 +64,7 @@ fn process_event_data(channel: StdioChannel, data: String, app_name: &str) {
|
|
|
|
|
StdioChannel::Stderr => "stderr",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
info!("[{}] {}: {}", c, app_name, data.trim_end());
|
|
|
|
|
info!("[{}] {}: {}", app_name, c, data.trim_end());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// run the main loop until out of holds
|
|
|
|
@ -109,6 +108,7 @@ fn run_loop(procs: Vec<Proc>, holds: Option<i8>, poll: Poll, signals: Signals) -
|
|
|
|
|
}
|
|
|
|
|
// process exited
|
|
|
|
|
Ok(ProcessEvent::Exit(status)) => {
|
|
|
|
|
info!("[{}]: exited with status {}", &proc.app.name, status);
|
|
|
|
|
let hold = proc.app.hold.unwrap_or(false);
|
|
|
|
|
if proc.app.check_restart(status) {
|
|
|
|
|
if let Ok(p) = restart_app(proc) {
|
|
|
|
|