add log message when removing stale client
This commit is contained in:
parent
71427f2879
commit
6100526610
1 changed files with 2 additions and 0 deletions
|
@ -3,6 +3,7 @@ package websocket
|
|||
import (
|
||||
"time"
|
||||
|
||||
"git.smsvc.net/pomodoro/GoTomato/internal/helper"
|
||||
"git.smsvc.net/pomodoro/GoTomato/pkg/models"
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
|
@ -33,6 +34,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, "clients", len(Clients))
|
||||
}
|
||||
}
|
||||
mu.Unlock()
|
||||
|
|
Loading…
Reference in a new issue