From c9d91008f83c2ee580f6b8dd39555b189b935cd2 Mon Sep 17 00:00:00 2001 From: hookenz Date: Tue, 30 Jan 2024 07:52:38 +1300 Subject: [PATCH] sleep before close to allow user to see the error msg --- api/http/handler/websocket/exec.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/http/handler/websocket/exec.go b/api/http/handler/websocket/exec.go index be66e255b..f2457b834 100644 --- a/api/http/handler/websocket/exec.go +++ b/api/http/handler/websocket/exec.go @@ -102,7 +102,10 @@ func (handler *Handler) handleExecRequest(w http.ResponseWriter, r *http.Request if err != nil { return err } - defer websocketConn.Close() + defer func() { + time.Sleep(10 * time.Second) + websocketConn.Close() + }() return hijackExecStartOperation(websocketConn, params.endpoint, params.ID, tokenData.Token) }