diff --git a/src/utils/runtime/src/lib.rs b/src/utils/runtime/src/lib.rs index d199c2709402..75a4a5f4d00b 100644 --- a/src/utils/runtime/src/lib.rs +++ b/src/utils/runtime/src/lib.rs @@ -97,13 +97,13 @@ where spawn_prof_thread(profile_path); } - let mut sigint = tokio::signal::unix::signal(SignalKind::interrupt()).unwrap(); - let mut sigterm = tokio::signal::unix::signal(SignalKind::terminate()).unwrap(); - let future_with_shutdown = async move { let shutdown = CancellationToken::new(); let mut fut = pin!(f(shutdown.clone())); + let mut sigint = tokio::signal::unix::signal(SignalKind::interrupt()).unwrap(); + let mut sigterm = tokio::signal::unix::signal(SignalKind::terminate()).unwrap(); + tokio::select! { biased;