mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 16:55: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() {
|
func (s *Stream) handleChannelKlineMessage() {
|
||||||
for {
|
for {
|
||||||
kline := <-s.klineMessage
|
select {
|
||||||
|
case kline := <-s.klineMessage:
|
||||||
if kline.Closed {
|
// FTX only returns closed kline
|
||||||
s.EmitKLineClosed(kline)
|
s.EmitKLineClosed(kline)
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
s.EmitKLine(kline)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user