mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +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:
@@ -1821,5 +1821,10 @@ func (c *Exchange) Validate() error {
|
||||
if c == nil {
|
||||
return errExchangeConfigIsNil
|
||||
}
|
||||
|
||||
if c.ConnectionMonitorDelay <= 0 {
|
||||
c.ConnectionMonitorDelay = DefaultConnectionMonitorDelay
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ const (
|
||||
defaultWebsocketResponseMaxLimit = time.Second * 7
|
||||
defaultWebsocketOrderbookBufferLimit = 5
|
||||
defaultWebsocketTrafficTimeout = time.Second * 30
|
||||
DefaultConnectionMonitorDelay = time.Second * 2
|
||||
maxAuthFailures = 3
|
||||
defaultNTPAllowedDifference = 50000000
|
||||
defaultNTPAllowedNegativeDifference = 50000000
|
||||
@@ -149,6 +150,7 @@ type Exchange struct {
|
||||
WebsocketResponseCheckTimeout time.Duration `json:"websocketResponseCheckTimeout"`
|
||||
WebsocketResponseMaxLimit time.Duration `json:"websocketResponseMaxLimit"`
|
||||
WebsocketTrafficTimeout time.Duration `json:"websocketTrafficTimeout"`
|
||||
ConnectionMonitorDelay time.Duration `json:"connectionMonitorDelay"`
|
||||
ProxyAddress string `json:"proxyAddress,omitempty"`
|
||||
BaseCurrencies currency.Currencies `json:"baseCurrencies"`
|
||||
CurrencyPairs *currency.PairsManager `json:"currencyPairs"`
|
||||
|
||||
Reference in New Issue
Block a user