diff --git a/internal/websocket/staleClients.go b/internal/websocket/staleClients.go index 31e56b5..b636c49 100644 --- a/internal/websocket/staleClients.go +++ b/internal/websocket/staleClients.go @@ -20,9 +20,9 @@ func RemoveStaleClients() { client.Conn.WriteMessage(websocket.PingMessage, nil) if isStale(client) { + helper.Logger.Info("Removing stale client", "host", client.RealIP, "lastPong", client.LastPong.Format(time.RFC3339)) client.Conn.Close() delete(Clients, client.Conn.LocalAddr()) - helper.Logger.Info("Removed stale client", "host", client.RealIP, "lastPong", client.LastPong.Format(time.RFC3339)) } } mu.Unlock()