diff --git a/internal/websocket/staleClients.go b/internal/websocket/staleClients.go index a3afe14..7e70553 100644 --- a/internal/websocket/staleClients.go +++ b/internal/websocket/staleClients.go @@ -16,7 +16,7 @@ func RemoveStaleClients() { for range ticker.C { mu.Lock() for _, client := range Clients { - if !sendPing(client) || isStale(client) { + if sendPing(client) && !isStale(client) { client.Conn.Close() delete(Clients, client.Conn.LocalAddr()) helper.Logger.Info("Removed stale client", "host", client.RealIP)