From 61179cfd3f4210840b025431f60d132e1cec0bce Mon Sep 17 00:00:00 2001 From: "nieznany.sprawiciel" Date: Mon, 26 Feb 2024 14:04:07 +0100 Subject: [PATCH] Gracefully shutdown runtime will set Terminated state --- src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 4b84f9d..c6e467f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -426,8 +426,9 @@ async fn run( signal = signal_receiver.recv() => { if let Some(signal) = signal { log::debug!("Received signal {signal}. Stopping runtime"); + ctx.process_controller.stop().await - .context("Stopping runtime error")?; + .context("Stopping runtime error")?; } Ok(()) }, @@ -435,6 +436,11 @@ async fn run( .context("Activity loop error")?; log::info!("Finished waiting"); + send_state( + &ctx, + ActivityState::from(StatePair(State::Terminated, None)), + ) + .await?; Ok(()) }