mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 14:33:53 +00:00
types: reset order book when stream disconnected
This commit is contained in:
parent
505decce48
commit
5b23671b44
|
@ -212,6 +212,10 @@ func (sb *StreamOrderBook) updateMetrics(t time.Time) {
|
|||
}
|
||||
|
||||
func (sb *StreamOrderBook) BindStream(stream Stream) {
|
||||
stream.OnDisconnect(func() {
|
||||
sb.Reset()
|
||||
})
|
||||
|
||||
stream.OnBookSnapshot(func(book SliceOrderBook) {
|
||||
if sb.MutexOrderBook.Symbol != book.Symbol {
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user