From 63fe82060a56e8c9aa645d3873c4156735525676 Mon Sep 17 00:00:00 2001 From: Jake Meyer Date: Sat, 9 Nov 2024 15:48:38 -0800 Subject: [PATCH] Restrict SIGTERM graceful shutdown to unix only --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index e2d9199..2347ed4 100755 --- a/src/main.rs +++ b/src/main.rs @@ -54,13 +54,17 @@ async fn main() -> Result<()> { .expect("failed to install Ctrl+C handler"); }; - // Handle SIGTERM + // Unix SIGTERM + #[cfg(unix)] let terminate = async { signal::unix::signal(signal::unix::SignalKind::terminate()) .expect("failed to install signal handler") .recv() .await; }; + + #[cfg(not(unix))] + let terminate = std::future::pending(); let graceful = client.clone(); let client_handle = client.run();