mirror of
https://github.com/minio/minio
synced 2024-09-06 00:37:25 +00:00
allow scanner key cycle to be empty (#18001)
configs from 2020 server throws an error due to deprecation of the keys however an attempt is made to parse them, we should have chosen existing defaults - this PR fixes that.
This commit is contained in:
parent
ca6dd8be5e
commit
e3fbcaeb72
|
@ -127,7 +127,11 @@ func lookupDeprecatedScannerConfig(kvs config.KVS) (cfg Config, err error) {
|
|||
if err != nil {
|
||||
return cfg, err
|
||||
}
|
||||
cfg.Cycle, err = time.ParseDuration(env.Get(EnvCycle, kvs.GetWithDefault(Cycle, DefaultKVS)))
|
||||
cycle := env.Get(EnvCycle, kvs.GetWithDefault(Cycle, DefaultKVS))
|
||||
if cycle == "" {
|
||||
cycle = "1m"
|
||||
}
|
||||
cfg.Cycle, err = time.ParseDuration(cycle)
|
||||
if err != nil {
|
||||
return cfg, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue