diff --git a/crates/weft-appd/src/main.rs b/crates/weft-appd/src/main.rs index 416ed30..f869290 100644 --- a/crates/weft-appd/src/main.rs +++ b/crates/weft-appd/src/main.rs @@ -93,6 +93,10 @@ impl SessionRegistry { pub(crate) fn broadcast(&self) -> &tokio::sync::broadcast::Sender { &self.broadcast } + + pub(crate) fn shutdown_all(&mut self) { + self.abort_senders.clear(); + } } #[tokio::main] @@ -175,6 +179,8 @@ async fn run() -> anyhow::Result<()> { } } + registry.lock().await.shutdown_all(); + tokio::time::sleep(tokio::time::Duration::from_millis(200)).await; let _ = std::fs::remove_file(&socket_path); Ok(()) }