diff --git a/src/config/retry_delay.rs b/src/config/retry_delay.rs index 09a0656..c3c07f5 100644 --- a/src/config/retry_delay.rs +++ b/src/config/retry_delay.rs @@ -11,7 +11,6 @@ pub struct RetryDelay(f64); impl RetryDelay { pub const NONE: RetryDelay = RetryDelay(0.0); - pub const NEVER: RetryDelay = RetryDelay(-1.0); pub fn from_secs(delay: f64) -> Self { Self(delay.max(0.0)) diff --git a/src/kubectl.rs b/src/kubectl.rs index 609b0b1..2533971 100644 --- a/src/kubectl.rs +++ b/src/kubectl.rs @@ -254,11 +254,7 @@ impl Kubectl { 1 => { // Kill the process if the exit code is 1 out_tx - .send(ChildEvent::Exit( - id, - status, - RestartPolicy::WillRestartIn(RetryDelay::NEVER) - )) + .send(ChildEvent::Exit(id, status, RestartPolicy::None)) .ok(); break 'new_process Err(anyhow!("Command returned status code 1")); } @@ -327,6 +323,7 @@ pub enum ChildEvent { #[derive(Debug)] pub enum RestartPolicy { WillRestartIn(RetryDelay), + None, } #[derive(Debug, thiserror::Error)] diff --git a/src/main.rs b/src/main.rs index 3875431..77e9c96 100644 --- a/src/main.rs +++ b/src/main.rs @@ -256,13 +256,14 @@ fn start_output_loop_thread(out_rx: Receiver) -> JoinHandle<()> { "{id}: Process exited with {} - retrying immediately", status ); - } else { - eprintln!( - "{id}: Process exited with {} - shutting process down", - status - ); } } + RestartPolicy::None => { + eprintln!( + "{id}: Process exited with {} - shutting process down", + status + ); + } } } ChildEvent::Error(id, error) => {