From 28613f85855c39b14665816177283d068a20c939 Mon Sep 17 00:00:00 2001 From: Nova Date: Mon, 28 Jul 2025 14:49:02 -0700 Subject: [PATCH] fix: actually remove clients on disconnect ya dunce --- src/core/client.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/client.rs b/src/core/client.rs index dc1c6cb..82cf362 100644 --- a/src/core/client.rs +++ b/src/core/client.rs @@ -27,8 +27,9 @@ use std::{ use tokio::{net::UnixStream, sync::watch, task::JoinHandle}; use tracing::info; +pub static CLIENTS: OwnedRegistry = OwnedRegistry::new(); + lazy_static! { - pub static ref CLIENTS: OwnedRegistry = OwnedRegistry::new(); static ref INTERNAL_CLIENT_MESSAGE_TIMES: (watch::Sender, watch::Receiver) = watch::channel(Instant::now()); pub static ref INTERNAL_CLIENT: Arc = CLIENTS.add(Client { pid: None, @@ -230,6 +231,7 @@ impl Client { if let Some(flush_join_handle) = self.flush_join_handle.get() { flush_join_handle.abort(); } + CLIENTS.remove(self); } } impl Debug for Client {