1
0
Fork 0

fix: nodes no longer beg to be kept alive

This commit is contained in:
Arthur K. 2026-01-19 22:50:12 +03:00
parent 7c4154a459
commit a32b0f728e
Signed by: wzray
GPG key ID: B97F30FDC4636357
12 changed files with 146 additions and 62 deletions

View file

@ -9,9 +9,10 @@ var DefaultConfig = Config{
},
Configs: Configs{
Master: MasterConfig{
ObserverInterval: 120,
ObserverInterval: 20,
BackoffSeconds: 1,
BackoffCount: 4,
NodeTimeout: 120,
},
},
}

View file

@ -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
}
}

View file

@ -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")
}