fix(ftx): start go routine while connecting to ftx websocket

This commit is contained in:
Jui-Nan Lin 2021-05-24 09:22:47 +08:00
parent 02912f362c
commit 2394aab32e

View File

@ -58,7 +58,6 @@ func NewStream(key, secret string, subAccount string, e *Exchange) *Stream {
s.EmitConnect()
})
go s.handleChannelKlineMessage()
return s
}
@ -75,6 +74,7 @@ func (s *Stream) Connect(ctx context.Context) error {
s.ctx = ctx
s.isConnected = true
s.EmitStart()
go s.handleChannelKlineMessage()
go func() {
// https://docs.ftx.com/?javascript#request-process