From 1552a105187ec3c6351b9c774dbc13ea5a6315a0 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Sat, 28 Dec 2024 22:57:13 +1100 Subject: [PATCH] v1.9.9-pre-6: clean exit --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- charge-controller-supervisor/src/main.rs | 7 +++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index afeab09..277a083 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -239,7 +239,7 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "charge-controller-supervisor" -version = "1.9.9-pre-5" +version = "1.9.9-pre-6" dependencies = [ "chrono", "clap", @@ -2201,7 +2201,7 @@ dependencies = [ [[package]] name = "tesla-charge-controller" -version = "1.9.9-pre-5" +version = "1.9.9-pre-6" dependencies = [ "chrono", "clap", diff --git a/Cargo.toml b/Cargo.toml index fa4416d..e5aab03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["charge-controller-supervisor"] resolver = "2" [workspace.package] -version = "1.9.9-pre-5" +version = "1.9.9-pre-6" [workspace.lints.clippy] pedantic = "warn" diff --git a/charge-controller-supervisor/src/main.rs b/charge-controller-supervisor/src/main.rs index 1444cd6..c0a1588 100644 --- a/charge-controller-supervisor/src/main.rs +++ b/charge-controller-supervisor/src/main.rs @@ -90,7 +90,6 @@ async fn watch(args: Args) -> eyre::Result<()> { match v { Some(Err(e)) => { log::error!("{e:?}"); - std::process::exit(1); } _ => { log::error!("no controller tasks left???"); @@ -98,7 +97,11 @@ async fn watch(args: Args) -> eyre::Result<()> { } } v = server_task => { - log::error!("server exited: {v:#?}"); + if let Err(e)=v { + log::error!("server exited: {e:#?}"); + } else { + std::process::exit(0); + } } }