diff --git a/internal/websocket/handle_connection.go b/internal/websocket/handle_connection.go index 360081e..cdb11cd 100644 --- a/internal/websocket/handle_connection.go +++ b/internal/websocket/handle_connection.go @@ -36,8 +36,7 @@ func HandleConnection(w http.ResponseWriter, r *http.Request) { LastPong: time.Now(), RealIP: r.RemoteAddr, } - - client.Conn.SetPongHandler(func(appData string) error { + client.Conn.SetPongHandler(func(s string) error { client.LastPong = time.Now() return nil }) diff --git a/pkg/models/client.go b/pkg/models/client.go index 632ea34..a99fe2d 100644 --- a/pkg/models/client.go +++ b/pkg/models/client.go @@ -39,7 +39,7 @@ func (c *WebsocketClient) SendMessage(messageType int, data []byte) error { return nil } -// Check if websockets last Pong is recent +// Checks if the websockets last Pong is recent func (c *WebsocketClient) IsStale() bool { return time.Since(c.LastPong) > (TIMEOUT * time.Second) }