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
1 changed files with 12 additions and 3 deletions

View File

@ -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");
}