From 54bba7c94345cb9bcc165b217366dcd12d320476 Mon Sep 17 00:00:00 2001 From: yuyi Date: Mon, 25 Mar 2024 21:07:31 +0800 Subject: [PATCH] chore(websocket): increase websocket idle timeout from 5s to 10m --- internal/dashboard/handler/conn_handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/dashboard/handler/conn_handler.go b/internal/dashboard/handler/conn_handler.go index ddd0867fa..14de062c9 100644 --- a/internal/dashboard/handler/conn_handler.go +++ b/internal/dashboard/handler/conn_handler.go @@ -67,7 +67,7 @@ func (w wsWrapper) Read(p []byte) (int, error) { w.cancel() return 0, err } - _ = w.conn.SetReadDeadline(time.Now().Add(5 * time.Second)) + _ = w.conn.SetReadDeadline(time.Now().Add(10 * time.Minute)) return r.Read(p) } @@ -78,7 +78,7 @@ func (w wsWrapper) Write(p []byte) (int, error) { w.cancel() return 0, err } - _ = w.conn.SetWriteDeadline(time.Now().Add(5 * time.Second)) + _ = w.conn.SetWriteDeadline(time.Now().Add(10 * time.Minute)) return len(p), nil }