From ed6902def00f897e9a45152416f68f277700c6e8 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 9c4b43f..1329198 100644 --- a/internal/websocket/handle_connection.go +++ b/internal/websocket/handle_connection.go @@ -31,8 +31,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, } mu.Lock() Clients[ws.LocalAddr()] = &client