From f06d2527be88fdb04ea8d7ee7c84ba37b83b71eb Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 5 Oct 2020 21:51:26 +0100 Subject: [PATCH] Correctly terminate if parts of the process terminate --- src/main.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1aecf68..4bb88d6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -46,16 +46,25 @@ fn do_update(compose_project: compose::ComposeProject, force_cycle: bool, force_ return; } - compose_project.pull(); + if !compose_project.pull() { + error!("Pull failed"); + return; + } let post_images = compose_project.get_images(); if force_cycle || post_images != pre_images { info!("Changes detected - Cycling container"); warn!("Stopping container"); - compose_project.down(); + if !compose_project.down() { + error!("Failed to stop container"); + return; + } warn!("Starting container"); - compose_project.up(); + if !compose_project.up() { + error!("Failed to start container"); + return; + } } else { info!("No change to images"); }