fix: nodes no longer beg to be kept alive
This commit is contained in:
parent
7c4154a459
commit
a32b0f728e
12 changed files with 146 additions and 62 deletions
|
|
@ -9,9 +9,10 @@ var DefaultConfig = Config{
|
|||
},
|
||||
Configs: Configs{
|
||||
Master: MasterConfig{
|
||||
ObserverInterval: 120,
|
||||
ObserverInterval: 20,
|
||||
BackoffSeconds: 1,
|
||||
BackoffCount: 4,
|
||||
NodeTimeout: 120,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import "errors"
|
|||
|
||||
type MasterConfig struct {
|
||||
ObserverInterval int `toml:"observer_interval"`
|
||||
|
||||
BackoffSeconds int `toml:"backoff_seconds"`
|
||||
BackoffCount int `toml:"backoff_count"`
|
||||
BackoffSeconds int `toml:"backoff_seconds"`
|
||||
BackoffCount int `toml:"backoff_count"`
|
||||
NodeTimeout int `toml:"node_timeout"`
|
||||
|
||||
baseRoleConfig
|
||||
}
|
||||
|
|
@ -24,6 +24,10 @@ func (c MasterConfig) Validate() error {
|
|||
return errors.New("invalid backoff_count")
|
||||
}
|
||||
|
||||
if c.NodeTimeout < 1 {
|
||||
return errors.New("invalid node_timeout")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -43,4 +47,8 @@ func (c *MasterConfig) Merge(other MasterConfig) {
|
|||
if other.BackoffCount != 0 {
|
||||
c.BackoffCount = other.BackoffCount
|
||||
}
|
||||
|
||||
if other.NodeTimeout != 0 {
|
||||
c.NodeTimeout = other.NodeTimeout
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ func (c NodeConfig) Validate() error {
|
|||
return errors.New("missing hostname")
|
||||
}
|
||||
|
||||
if c.KeepaliveInterval < 1 && c.KeepaliveInterval != -1 {
|
||||
if c.KeepaliveInterval < 1 {
|
||||
return errors.New("invalid keepalive_interval")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue