mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-08 23:16:54 +00:00
stream/match: Reduce complexity and limit locking when match occurs (#1581)
* stream match update * update tests * linter: fix * glorious: nits + handle context cancellations * glorious: whooops * Websocket: Add SendMessageReturnResponses * whooooooopsie * gk: nitssssss * Update exchanges/stream/stream_match.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * Update exchanges/stream/stream_match_test.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * linter: appease the linter gods * glorious: nits * glorious: nits * Update exchanges/stream/stream_match_test.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
This commit is contained in:
@@ -147,7 +147,7 @@ func (d *Deribit) wsLogin(ctx context.Context) error {
|
||||
"signature": crypto.HexEncodeToString(hmac),
|
||||
},
|
||||
}
|
||||
resp, err := d.Websocket.Conn.SendMessageReturnResponse(request.ID, request)
|
||||
resp, err := d.Websocket.Conn.SendMessageReturnResponse(context.TODO(), request.ID, request)
|
||||
if err != nil {
|
||||
d.Websocket.SetCanUseAuthenticatedEndpoints(false)
|
||||
return err
|
||||
@@ -1165,7 +1165,7 @@ func (d *Deribit) handleSubscription(operation string, channels subscription.Lis
|
||||
return err
|
||||
}
|
||||
for x := range payloads {
|
||||
data, err := d.Websocket.Conn.SendMessageReturnResponse(payloads[x].ID, payloads[x])
|
||||
data, err := d.Websocket.Conn.SendMessageReturnResponse(context.TODO(), payloads[x].ID, payloads[x])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -2406,7 +2406,7 @@ func (d *Deribit) sendWsPayload(ep request.EndpointLimit, input *WsRequest, resp
|
||||
log.Debugf(log.RequestSys, "%s attempt %d", d.Name, attempt)
|
||||
}
|
||||
var payload []byte
|
||||
payload, err = d.Websocket.Conn.SendMessageReturnResponse(input.ID, input)
|
||||
payload, err = d.Websocket.Conn.SendMessageReturnResponse(context.TODO(), input.ID, input)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user