From 5d0a9fbff75476bb5b4698ade1194cd0028dab14 Mon Sep 17 00:00:00 2001 From: euzu Date: Wed, 11 Jun 2025 15:52:23 +0200 Subject: [PATCH] User connection remove fix --- src/api/model/active_user_manager.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/api/model/active_user_manager.rs b/src/api/model/active_user_manager.rs index 5b4598b32..6daf5aa50 100644 --- a/src/api/model/active_user_manager.rs +++ b/src/api/model/active_user_manager.rs @@ -196,10 +196,14 @@ impl ActiveUserManager { connection_data.connections -= 1; } - if connection_data.connections == 0 || connection_data.connections < connection_data.max_connections { - // Grace timeout expired, reset grace counters - connection_data.granted_grace = false; - connection_data.grace_ts = 0; + if connection_data.connections == 0 { + lock.remove(username); + } else { + if connection_data.connections < connection_data.max_connections { + // Grace timeout expired, reset grace counters + connection_data.granted_grace = false; + connection_data.grace_ts = 0; + } } } drop(lock);