From 6e8840f0fc60ca560a8d4fdeb71de0991e7c8039 Mon Sep 17 00:00:00 2001 From: topi314 Date: Fri, 24 May 2024 19:14:11 +0200 Subject: [PATCH] fix stuck at mutex when reconnecting and error happens in Gateway.Open --- gateway/gateway_impl.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gateway/gateway_impl.go b/gateway/gateway_impl.go index e1d5d5cb..4ea8665a 100644 --- a/gateway/gateway_impl.go +++ b/gateway/gateway_impl.go @@ -94,8 +94,7 @@ func (g *gatewayImpl) open(ctx context.Context) error { g.lastHeartbeatSent = time.Now().UTC() conn, rs, err := g.config.Dialer.DialContext(ctx, gatewayURL, nil) if err != nil { - g.Close(ctx) - body := "empty" + body := "" if rs != nil && rs.Body != nil { defer func() { _ = rs.Body.Close()