1
Fork 0

Correctly terminate if parts of the process terminate

This commit is contained in:
Jake Howard 2020-10-05 21:51:26 +01:00
parent 2d3bc78beb
commit f06d2527be
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -46,16 +46,25 @@ fn do_update(compose_project: compose::ComposeProject, force_cycle: bool, force_
return; return;
} }
compose_project.pull(); if !compose_project.pull() {
error!("Pull failed");
return;
}
let post_images = compose_project.get_images(); let post_images = compose_project.get_images();
if force_cycle || post_images != pre_images { if force_cycle || post_images != pre_images {
info!("Changes detected - Cycling container"); info!("Changes detected - Cycling container");
warn!("Stopping container"); warn!("Stopping container");
compose_project.down(); if !compose_project.down() {
error!("Failed to stop container");
return;
}
warn!("Starting container"); warn!("Starting container");
compose_project.up(); if !compose_project.up() {
error!("Failed to start container");
return;
}
} else { } else {
info!("No change to images"); info!("No change to images");
} }