From b8bf6b6f43c7758a7230e30329372964590b8297 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Wed, 24 Sep 2025 21:47:36 +0200 Subject: [PATCH] feat: print as well Signed-off-by: kjuulh --- Cargo.lock | 2 +- crates/noleader/src/lib.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 44b83ac..86bba5d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -918,7 +918,7 @@ dependencies = [ [[package]] name = "noleader" -version = "0.1.2" +version = "0.1.3" dependencies = [ "anyhow", "async-nats", diff --git a/crates/noleader/src/lib.rs b/crates/noleader/src/lib.rs index cc60627..ecf2f6a 100644 --- a/crates/noleader/src/lib.rs +++ b/crates/noleader/src/lib.rs @@ -133,6 +133,8 @@ impl Leader { F: Fn(CancellationToken) -> Fut, Fut: Future> + Send + 'static, { + let cancellation_token = cancellation_token.child_token(); + loop { if cancellation_token.is_cancelled() { return Ok(()); @@ -170,6 +172,7 @@ impl Leader { } }); + tracing::info!("starting leader actions"); let res = f(child_token).await; guard.abort();