From a0463ad81713ea980e2b7fac673fa8447a0d5f40 Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Wed, 20 Nov 2024 21:52:08 +0100 Subject: [PATCH] comment updates --- internal/websocket/handle_connection.go | 3 +-- pkg/models/client.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) 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) }