fn handle_restart_strategy(service_handler: &ServiceHandler, is_failed: bool) -> Event {
    let new_status = match service_handler.service.restart.strategy {
        RestartStrategy::Never if is_failed => {
            debug!(
                "restart attemps: {}, are over: {}, max: {}",
                service_handler.restart_attempts,
                service_handler.restart_attempts_are_over(),
                service_handler.service.restart.attempts
            );
            if service_handler.restart_attempts_are_over() {
                ServiceStatus::FinishedFailed
            } else {
                ServiceStatus::Initial
            }
        }
        RestartStrategy::OnFailure if is_failed => ServiceStatus::Initial,
        RestartStrategy::Never | RestartStrategy::OnFailure => ServiceStatus::Finished,
        RestartStrategy::Always => ServiceStatus::Initial,
    };
    debug!("Restart strategy applied, ev: {:?}", new_status);
    Event::new_status_update(service_handler.name(), new_status)
}
/// Produces events based on the Restart Strategy of the service.
Produces events based on the Restart Strategy of the service.
Produces events based on the Restart Strategy of the service .
fn handle_restart_strategy(service_handler: &ServiceHandler, is_failed: bool) -> Event {
    let new_status = match service_handler.service.restart.strategy {
        RestartStrategy::Never if is_failed => {
            debug!(
                "restart attemps: {}, are over: {}, max: {}",
                service_handler.restart_attempts,
                service_handler.restart_attempts_are_over(),
                service_handler.service.restart.attempts
            );
            if service_handler.restart_attempts_are_over() {
                ServiceStatus::FinishedFailed
            } else {
                ServiceStatus::Initial
            }
        }
        RestartStrategy::OnFailure if is_failed => ServiceStatus::Initial,
        RestartStrategy::Never | RestartStrategy::OnFailure => ServiceStatus::Finished,
        RestartStrategy::Always => ServiceStatus::Initial,
    };
    debug!("Restart strategy applied, ev: {:?}", new_status);
    Event::new_status_update(service_handler.name(), new_status)
}
fn handle_restart_strategy ( service_handler : & ServiceHandler , is_failed : bool ) -> Event { let new_status = match service_handler . service . restart . strategy { RestartStrategy :: Never if is_failed => { debug ! ( " " service_handler restart_attempts service_handler restart_attempts_are_over ( ) service_handler service restart attempts ) ; if service_handler . restart_attempts_are_over ( ) { ServiceStatus :: FinishedFailed } else { ServiceStatus :: Initial } } RestartStrategy :: OnFailure if is_failed => ServiceStatus :: Initial , RestartStrategy :: Never | RestartStrategy :: OnFailure => ServiceStatus :: Finished , RestartStrategy :: Always => ServiceStatus :: Initial , } ; debug ! ( " " new_status ) ; Event :: new_status_update ( service_handler . name ( ) , new_status ) }
Produces events based on the Restart Strategy of the service.
Produces events based on the Restart Strategy of the service .
service_handler
&ServiceHandler
is_failed
bool
service_handler
&ServiceHandler
is_failed
bool