mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-17 15:09:59 +00:00
Binance: websocket orderbook reconnection fix, some bug fix (#630)
* binance websocket orderbook reconnection fix * add context.WithDeadline * Deadline() context still not resolved * stage1 * fmt * cleanup * fix applyBufferUpdate err returning * remove comment * remove extra return * increase Binance maxWSUpdateBuffer Co-authored-by: Vazha Bezhanishvili <vazha.bezhanishvili@elegro.eu> Co-authored-by: gloriousCode <scott.grant@thrasher.io>
This commit is contained in:
@@ -174,7 +174,7 @@ func (r *Requester) doRequest(req *http.Request, p *Item) error {
|
||||
delay = after
|
||||
}
|
||||
|
||||
if d, ok := req.Context().Deadline(); ok && d.After(time.Now().Add(delay)) {
|
||||
if d, ok := req.Context().Deadline(); ok && d.After(time.Now()) && time.Now().Add(delay).After(d) {
|
||||
if err != nil {
|
||||
return fmt.Errorf("request.go error - deadline would be exceeded by retry, err: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user