mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
Merge pull request #1266 from c9s/c9s/exit-ping-worker-when-err
FIX: types: exit ping worker when error is happened
This commit is contained in:
commit
fe0a630fa8
|
@ -274,6 +274,7 @@ func (s *StandardStream) ping(ctx context.Context, conn *websocket.Conn, cancel
|
|||
if err := conn.WriteControl(websocket.PingMessage, nil, time.Now().Add(writeTimeout)); err != nil {
|
||||
log.WithError(err).Error("ping error", err)
|
||||
s.Reconnect()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -306,6 +307,7 @@ func (s *StandardStream) Connect(ctx context.Context) error {
|
|||
}
|
||||
|
||||
// start one re-connector goroutine with the base context
|
||||
// reconnector goroutine does not exit when the connection is closed
|
||||
go s.reconnector(ctx)
|
||||
|
||||
s.EmitStart()
|
||||
|
|
Loading…
Reference in New Issue
Block a user