From b1ddcb33e0fc395d1eef34ed575382ba5fac0f8e Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Wed, 20 Nov 2024 20:26:04 +0100 Subject: [PATCH] init LastPong --- internal/websocket/handle_connection.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/websocket/handle_connection.go b/internal/websocket/handle_connection.go index 46ce71d..39b94d7 100644 --- a/internal/websocket/handle_connection.go +++ b/internal/websocket/handle_connection.go @@ -32,8 +32,9 @@ func HandleConnection(w http.ResponseWriter, r *http.Request) { // Register the new client client := models.WebsocketClient{ - Conn: ws, - RealIP: r.RemoteAddr, + Conn: ws, + LastPong: time.Now(), + RealIP: r.RemoteAddr, } client.Conn.SetPongHandler(func(s string) error {