feat: print as well
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2025-09-24 21:47:36 +02:00
parent c4c0d82305
commit b8bf6b6f43
2 changed files with 4 additions and 1 deletions

2
Cargo.lock generated
View File

@@ -918,7 +918,7 @@ dependencies = [
[[package]] [[package]]
name = "noleader" name = "noleader"
version = "0.1.2" version = "0.1.3"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-nats", "async-nats",

View File

@@ -133,6 +133,8 @@ impl Leader {
F: Fn(CancellationToken) -> Fut, F: Fn(CancellationToken) -> Fut,
Fut: Future<Output = anyhow::Result<()>> + Send + 'static, Fut: Future<Output = anyhow::Result<()>> + Send + 'static,
{ {
let cancellation_token = cancellation_token.child_token();
loop { loop {
if cancellation_token.is_cancelled() { if cancellation_token.is_cancelled() {
return Ok(()); return Ok(());
@@ -170,6 +172,7 @@ impl Leader {
} }
}); });
tracing::info!("starting leader actions");
let res = f(child_token).await; let res = f(child_token).await;
guard.abort(); guard.abort();