From eefee46e9bebd7bdf413692900822cb8238861b0 Mon Sep 17 00:00:00 2001 From: c9s Date: Tue, 11 Jan 2022 13:38:03 +0800 Subject: [PATCH] binance: invert if --- pkg/exchange/binance/stream.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/exchange/binance/stream.go b/pkg/exchange/binance/stream.go index 58fd4fad6..ff039ba26 100644 --- a/pkg/exchange/binance/stream.go +++ b/pkg/exchange/binance/stream.go @@ -448,9 +448,7 @@ func (s *Stream) listenKeyKeepAlive(ctx context.Context, listenKey string) { case <-keepAliveTicker.C: for i := 0; i < 5; i++ { err := s.keepaliveListenKey(ctx, listenKey) - if err == nil { - break - } else { + if err != nil { time.Sleep(5 * time.Second) switch err.(type) { case net.Error: @@ -463,6 +461,8 @@ func (s *Stream) listenKeyKeepAlive(ctx context.Context, listenKey string) { return } + } else { + break } }