mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
okx: Move WsResponseMultiplexer to SetDefaults (#1829)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
This commit is contained in:
@@ -181,6 +181,14 @@ func (ok *Okx) SetDefaults() {
|
||||
ok.WebsocketResponseMaxLimit = websocketResponseMaxLimit
|
||||
ok.WebsocketResponseCheckTimeout = websocketResponseMaxLimit
|
||||
ok.WebsocketOrderbookBufferLimit = exchange.DefaultWebsocketOrderbookBufferLimit
|
||||
|
||||
ok.WsResponseMultiplexer = wsRequestDataChannelsMultiplexer{
|
||||
WsResponseChannelsMap: make(map[string]*wsRequestInfo),
|
||||
Register: make(chan *wsRequestInfo),
|
||||
Unregister: make(chan string),
|
||||
Message: make(chan *wsIncomingData),
|
||||
shutdown: make(chan bool),
|
||||
}
|
||||
}
|
||||
|
||||
// Setup takes in the supplied exchange configuration details and sets params
|
||||
@@ -196,14 +204,6 @@ func (ok *Okx) Setup(exch *config.Exchange) error {
|
||||
return err
|
||||
}
|
||||
|
||||
ok.WsResponseMultiplexer = wsRequestDataChannelsMultiplexer{
|
||||
WsResponseChannelsMap: make(map[string]*wsRequestInfo),
|
||||
Register: make(chan *wsRequestInfo),
|
||||
Unregister: make(chan string),
|
||||
Message: make(chan *wsIncomingData),
|
||||
shutdown: make(chan bool),
|
||||
}
|
||||
|
||||
wsRunningEndpoint, err := ok.API.Endpoints.GetURL(exchange.WebsocketSpot)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user