mirror of https://github.com/status-im/consul.git
remove config
This commit is contained in:
parent
7b4720a957
commit
cc07734d6e
|
@ -263,12 +263,6 @@ type Config struct {
|
|||
CheckUpdateInterval time.Duration `mapstructure:"-"`
|
||||
CheckUpdateIntervalRaw string `mapstructure:"check_update_interval" json:"-"`
|
||||
|
||||
// CheckUpdateStagger enables a randomization of the CheckUpdateInterval between
|
||||
// .5 and 1.5 of that interval. This is useful if checks happen often to stagger
|
||||
// writes and pervent them from all executing at the end of the same CheckUpdateInterval.
|
||||
// Off by default.
|
||||
CheckUpdateStagger bool `mapstructure:"check_update_stagger"`
|
||||
|
||||
// ACLToken is the default token used to make requests if a per-request
|
||||
// token is not provided. If not configured the 'anonymous' token is used.
|
||||
ACLToken string `mapstructure:"acl_token" json:"-"`
|
||||
|
@ -930,9 +924,6 @@ func MergeConfig(a, b *Config) *Config {
|
|||
if b.CheckUpdateIntervalRaw != "" || b.CheckUpdateInterval != 0 {
|
||||
result.CheckUpdateInterval = b.CheckUpdateInterval
|
||||
}
|
||||
if b.CheckUpdateStagger {
|
||||
result.CheckUpdateStagger = true
|
||||
}
|
||||
if b.SyslogFacility != "" {
|
||||
result.SyslogFacility = b.SyslogFacility
|
||||
}
|
||||
|
|
|
@ -494,17 +494,6 @@ func TestDecodeConfig(t *testing.T) {
|
|||
t.Fatalf("bad: %#v", config)
|
||||
}
|
||||
|
||||
// CheckUpdateStagger
|
||||
input = `{"check_update_stagger": true}`
|
||||
config, err = DecodeConfig(bytes.NewReader([]byte(input)))
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if !config.CheckUpdateStagger {
|
||||
t.Fatalf("bad: %#v", config)
|
||||
}
|
||||
|
||||
// ACLs
|
||||
input = `{"acl_token": "1234", "acl_datacenter": "dc2",
|
||||
"acl_ttl": "60s", "acl_down_policy": "deny",
|
||||
|
|
|
@ -208,12 +208,7 @@ func (l *localState) UpdateCheck(checkID, status, output string) {
|
|||
if l.config.CheckUpdateInterval > 0 && check.Status == status {
|
||||
check.Output = output
|
||||
if _, ok := l.deferCheck[checkID]; !ok {
|
||||
var intv time.Duration
|
||||
if l.config.CheckUpdateStagger {
|
||||
intv = time.Duration(uint64(l.config.CheckUpdateInterval)/2) + randomStagger(l.config.CheckUpdateInterval)
|
||||
} else {
|
||||
intv = l.config.CheckUpdateInterval
|
||||
}
|
||||
intv := time.Duration(uint64(l.config.CheckUpdateInterval)/2) + randomStagger(l.config.CheckUpdateInterval)
|
||||
deferSync := time.AfterFunc(intv, func() {
|
||||
l.Lock()
|
||||
if _, ok := l.checkStatus[checkID]; ok {
|
||||
|
|
|
@ -353,12 +353,6 @@ definitions support being updated during a reload.
|
|||
reduce write pressure. If a check ever changes state, the new state and associated
|
||||
output is synchronized immediately. To disable this behavior, set the value to "0s".
|
||||
|
||||
* <a name="check_update_stagger"></a><a href="#check_update_stagger">`check_update_stagger`</a>
|
||||
CheckUpdateStagger enables a randomization of the CheckUpdateInterval between
|
||||
.5 and 1.5 of that interval. This is useful if checks happen often to stagger
|
||||
writes and pervent them from all executing at the end of the same CheckUpdateInterval.
|
||||
Off by default.
|
||||
|
||||
* <a name="client_addr"></a><a href="#client_addr">`client_addr`</a> Equivalent to the
|
||||
[`-client` command-line flag](#_client).
|
||||
|
||||
|
|
Loading…
Reference in New Issue