mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-05 15:10:59 +00:00
exchanges: Initial context propagation (#744)
* gct: phase one context awareness pass * exchanges: context propagation pass * common/requester: force context requirement * gctcli/exchanges: linter fix * rpcserver: fix test using dummy rpc server * backtester: fix comments * grpc: add correct cancel and timeout for commands * rpcserver_test: add comment on dummy server * common: deprecated SendHTTPGetRequest * linter: fix * linter: turn on no context check * apichecker: fix context linter issue * binance: use param context * common: remove checks as this gets executed before main * common: change mutex to RW as clients can be used by multiple go routines. * common: remove init and JIT default client. Unexport global variables and add protection. * common: Add comments * bithumb: after dinner mints fix
This commit is contained in:
@@ -71,7 +71,7 @@ func (b *Bittrex) WsConnect() error {
|
||||
}
|
||||
|
||||
var wsHandshakeData WsSignalRHandshakeData
|
||||
err := b.WsSignalRHandshake(&wsHandshakeData)
|
||||
err := b.WsSignalRHandshake(context.TODO(), &wsHandshakeData)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -128,7 +128,7 @@ func (b *Bittrex) WsConnect() error {
|
||||
}
|
||||
|
||||
// WsSignalRHandshake requests the SignalR connection token over https
|
||||
func (b *Bittrex) WsSignalRHandshake(result interface{}) error {
|
||||
func (b *Bittrex) WsSignalRHandshake(ctx context.Context, result interface{}) error {
|
||||
endpoint, err := b.API.Endpoints.GetURL(exchange.WebsocketSpotSupplementary)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -142,7 +142,7 @@ func (b *Bittrex) WsSignalRHandshake(result interface{}) error {
|
||||
HTTPDebugging: b.HTTPDebugging,
|
||||
HTTPRecording: b.HTTPRecording,
|
||||
}
|
||||
return b.SendPayload(context.Background(), request.Unset, func() (*request.Item, error) {
|
||||
return b.SendPayload(ctx, request.Unset, func() (*request.Item, error) {
|
||||
return item, nil
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user