binance: invert if

This commit is contained in:
c9s 2022-01-11 13:38:03 +08:00
parent cf07ca7aa0
commit eefee46e9b

View File

@ -448,9 +448,7 @@ func (s *Stream) listenKeyKeepAlive(ctx context.Context, listenKey string) {
case <-keepAliveTicker.C: case <-keepAliveTicker.C:
for i := 0; i < 5; i++ { for i := 0; i < 5; i++ {
err := s.keepaliveListenKey(ctx, listenKey) err := s.keepaliveListenKey(ctx, listenKey)
if err == nil { if err != nil {
break
} else {
time.Sleep(5 * time.Second) time.Sleep(5 * time.Second)
switch err.(type) { switch err.(type) {
case net.Error: case net.Error:
@ -463,6 +461,8 @@ func (s *Stream) listenKeyKeepAlive(ctx context.Context, listenKey string) {
return return
} }
} else {
break
} }
} }