Support dynamic reset of minio config (#13626)

If a given MinIO config is dynamic (can be changed without restart),
ensure that it can be reset also without restart.

Signed-off-by: Shireesh Anjal <shireesh@minio.io>
This commit is contained in:
Shireesh Anjal
2021-11-10 23:31:32 +05:30
committed by GitHub
parent ea820b30bf
commit d008e90d50
4 changed files with 42 additions and 16 deletions
+3 -3
View File
@@ -95,7 +95,7 @@ func LookupConfig(kvs config.KVS) (cfg Config, err error) {
}
delay := env.Get(EnvDelayLegacy, "")
if delay == "" {
delay = env.Get(EnvDelay, kvs.Get(Delay))
delay = env.Get(EnvDelay, kvs.GetWithDefault(Delay, DefaultKVS))
}
cfg.Delay, err = strconv.ParseFloat(delay, 64)
if err != nil {
@@ -103,14 +103,14 @@ func LookupConfig(kvs config.KVS) (cfg Config, err error) {
}
maxWait := env.Get(EnvMaxWaitLegacy, "")
if maxWait == "" {
maxWait = env.Get(EnvMaxWait, kvs.Get(MaxWait))
maxWait = env.Get(EnvMaxWait, kvs.GetWithDefault(MaxWait, DefaultKVS))
}
cfg.MaxWait, err = time.ParseDuration(maxWait)
if err != nil {
return cfg, err
}
cfg.Cycle, err = time.ParseDuration(env.Get(EnvCycle, kvs.Get(Cycle)))
cfg.Cycle, err = time.ParseDuration(env.Get(EnvCycle, kvs.GetWithDefault(Cycle, DefaultKVS)))
if err != nil {
return cfg, err
}