mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 23:05:15 +00:00
fix(ftx): use select to handle kline message
This commit is contained in:
parent
bbeafab59b
commit
bd9a61ea97
|
@ -132,14 +132,11 @@ func (s *Stream) Subscribe(channel types.Channel, symbol string, option types.Su
|
|||
|
||||
func (s *Stream) handleChannelKlineMessage() {
|
||||
for {
|
||||
kline := <-s.klineMessage
|
||||
|
||||
if kline.Closed {
|
||||
select {
|
||||
case kline := <-s.klineMessage:
|
||||
// FTX only returns closed kline
|
||||
s.EmitKLineClosed(kline)
|
||||
continue
|
||||
}
|
||||
|
||||
s.EmitKLine(kline)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user