mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
binance: emit reconnect when received ListenKeyExpired
This commit is contained in:
parent
ff635195fb
commit
f2e3acf8ec
|
@ -127,6 +127,9 @@ func NewStream(ex *Exchange, client *binance.Client, futuresClient *futures.Clie
|
|||
stream.OnOrderTradeUpdateEvent(stream.handleOrderTradeUpdateEvent)
|
||||
stream.OnDisconnect(stream.handleDisconnect)
|
||||
stream.OnConnect(stream.handleConnect)
|
||||
stream.OnListenKeyExpired(func(e *ListenKeyExpired) {
|
||||
stream.Reconnect()
|
||||
})
|
||||
return stream
|
||||
}
|
||||
|
||||
|
@ -368,7 +371,7 @@ func (s *Stream) dispatchEvent(e interface{}) {
|
|||
|
||||
case *ListenKeyExpired:
|
||||
s.EmitListenKeyExpired(e)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user