update stale removal logging

This commit is contained in:
Sebastian Mark 2024-11-21 20:25:12 +01:00
parent 8b7e8350a0
commit e671ad9dd4

View file

@ -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()