|
|
@@ -67,8 +67,8 @@ type Config struct {
|
|
|
ShowVersion bool
|
|
|
Verbose bool `toml:"verbose" env:"ETCD_VERBOSE"`
|
|
|
VeryVerbose bool `toml:"very_verbose" env:"ETCD_VERY_VERBOSE"`
|
|
|
- HeartbeatTimeout int
|
|
|
- ElectionTimeout int
|
|
|
+ HeartbeatTimeout int `toml:"peer_heartbeat_timeout" env:"ETCD_PEER_HEARTBEAT_TIMEOUT"`
|
|
|
+ ElectionTimeout int `toml:"peer_election_timeout" env:"ETCD_PEER_ELECTION_TIMEOUT"`
|
|
|
Peer struct {
|
|
|
Addr string `toml:"addr" env:"ETCD_PEER_ADDR"`
|
|
|
BindAddr string `toml:"bind_addr" env:"ETCD_PEER_BIND_ADDR"`
|
|
|
@@ -88,6 +88,8 @@ func NewConfig() *Config {
|
|
|
c.MaxRetryAttempts = 3
|
|
|
c.Peer.Addr = "127.0.0.1:7001"
|
|
|
c.SnapshotCount = 10000
|
|
|
+ c.HeartbeatTimeout = HeartbeatTimeout
|
|
|
+ c.ElectionTimeout = ElectionTimeout
|
|
|
return c
|
|
|
}
|
|
|
|
|
|
@@ -229,8 +231,8 @@ func (c *Config) LoadFlags(arguments []string) error {
|
|
|
f.IntVar(&c.MaxResultBuffer, "max-result-buffer", c.MaxResultBuffer, "")
|
|
|
f.IntVar(&c.MaxRetryAttempts, "max-retry-attempts", c.MaxRetryAttempts, "")
|
|
|
f.IntVar(&c.MaxClusterSize, "max-cluster-size", c.MaxClusterSize, "")
|
|
|
- f.IntVar(&c.HeartbeatTimeout, "peer-heartbeat-timeout", HeartbeatTimeout, "")
|
|
|
- f.IntVar(&c.ElectionTimeout, "peer-election-timeout", ElectionTimeout, "")
|
|
|
+ f.IntVar(&c.HeartbeatTimeout, "peer-heartbeat-timeout", c.HeartbeatTimeout, "")
|
|
|
+ f.IntVar(&c.ElectionTimeout, "peer-election-timeout", c.ElectionTimeout, "")
|
|
|
|
|
|
f.StringVar(&cors, "cors", "", "")
|
|
|
|