Compare commits

...

2 commits

Author SHA1 Message Date
6f355fe441 XXX add debug log for ping fail 2024-11-21 19:52:18 +01:00
a98b4bc154 add LastPong to stale log message 2024-11-21 19:52:10 +01:00

View file

@ -19,7 +19,7 @@ func RemoveStaleClients() {
if !sendPing(client) || isStale(client) {
client.Conn.Close()
delete(Clients, client.Conn.LocalAddr())
helper.Logger.Info("Removed stale client", "host", client.RealIP)
helper.Logger.Info("Removed stale client", "host", client.RealIP, "lastPong", client.LastPong)
}
}
mu.Unlock()
@ -31,6 +31,7 @@ func sendPing(client *models.WebsocketClient) bool {
err := client.Conn.WriteMessage(websocket.PingMessage, nil)
if err != nil {
helper.Logger.Debug("ping failed", "host", client.RealIP)
return false
}