From 9f8d70449140376cf5c471351f957ce11fc7703d Mon Sep 17 00:00:00 2001 From: Gareth Kirwan Date: Tue, 22 Oct 2024 13:05:13 +0700 Subject: [PATCH] fixup! Bitmex: Handle subscription errors --- exchanges/bitmex/bitmex_websocket.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exchanges/bitmex/bitmex_websocket.go b/exchanges/bitmex/bitmex_websocket.go index b9edb1cc1ce..c6297404116 100644 --- a/exchanges/bitmex/bitmex_websocket.go +++ b/exchanges/bitmex/bitmex_websocket.go @@ -83,8 +83,6 @@ var defaultSubscriptions = subscription.List{ // WsConnect initiates a new websocket connection func (b *Bitmex) WsConnect() error { - ctx := context.TODO() - if !b.Websocket.IsEnabled() || !b.IsEnabled() { return stream.ErrWebsocketNotEnabled } @@ -96,6 +94,7 @@ func (b *Bitmex) WsConnect() error { b.Websocket.Wg.Add(1) go b.wsReadData() + ctx := context.TODO() if err := b.wsOpenStream(ctx, b.Websocket.Conn, wsPublicStream); err != nil { return err }