From 0c89ff3224bbebdd0c262e42df0a163c0559edc9 Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Thu, 21 Nov 2024 08:57:43 +0100 Subject: [PATCH] add log message when removing stale client --- internal/websocket/staleClients.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/websocket/staleClients.go b/internal/websocket/staleClients.go index d64960e..e45e62c 100644 --- a/internal/websocket/staleClients.go +++ b/internal/websocket/staleClients.go @@ -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()