mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-22 07:26:50 +00:00
stream: set connection monitor delay. (#1120)
* stream: set connection monitor delay. - this fixes a bug where the connection monitor delay config value does not get set to the websocket on intialization. * multi: add connection monitor delay to exchange config. - this adds the connection monitor delay config option to the exchange type. - the validate function of the exchange type has been updated to validate the connection monitor delay value as well. * multi: resolve review issues.
This commit is contained in:
@@ -115,8 +115,9 @@ func (w *Websocket) Setup(s *WebsocketSetup) error {
|
||||
if w.features.Unsubscribe && s.Unsubscriber == nil {
|
||||
return fmt.Errorf("%s %w", w.exchangeName, errWebsocketUnsubscriberUnset)
|
||||
}
|
||||
if s.ConnectionMonitorDelay <= 0 {
|
||||
w.connectionMonitorDelay = defaultConnectionMonitorDelay
|
||||
w.connectionMonitorDelay = s.ConnectionMonitorDelay
|
||||
if w.connectionMonitorDelay <= 0 {
|
||||
w.connectionMonitorDelay = config.DefaultConnectionMonitorDelay
|
||||
}
|
||||
w.Unsubscriber = s.Unsubscriber
|
||||
|
||||
|
||||
@@ -15,9 +15,7 @@ import (
|
||||
// Websocket functionality list and state consts
|
||||
const (
|
||||
// WebsocketNotEnabled alerts of a disabled websocket
|
||||
WebsocketNotEnabled = "exchange_websocket_not_enabled"
|
||||
// defaultConnectionMonitorDelay connection monitor time delays and limits
|
||||
defaultConnectionMonitorDelay = 2 * time.Second
|
||||
WebsocketNotEnabled = "exchange_websocket_not_enabled"
|
||||
WebsocketNotAuthenticatedUsingRest = "%v - Websocket not authenticated, using REST\n"
|
||||
Ping = "ping"
|
||||
Pong = "pong"
|
||||
|
||||
Reference in New Issue
Block a user