From 287af9dc8162869a52343f21deeeeda205f6e8bf Mon Sep 17 00:00:00 2001 From: mleku Date: Mon, 18 Aug 2025 20:15:38 +0100 Subject: [PATCH] fix: replace `break` with `return` in error handling for ws client - pkg/protocol/ws/client.go - Changed `break` to `return` to ensure proper error handling flow in `client.go`. this bug was causing the CPU usage to go very high from fmt.Errorf statements. changed them to errorf.E so they printed and were visible. --- pkg/protocol/ws/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/protocol/ws/client.go b/pkg/protocol/ws/client.go index 9a64a91..3153007 100644 --- a/pkg/protocol/ws/client.go +++ b/pkg/protocol/ws/client.go @@ -273,7 +273,7 @@ func (r *Client) ConnectWithTLS( ); err != nil { r.ConnectionError = err r.Close() - break + return } message := buf.Bytes() var t string