mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdmain: check for empty AutoCompactionRetention
This commit is contained in:
parent
253259452b
commit
0e1993f131
@ -132,6 +132,10 @@ func StartEtcd(inCfg *Config) (e *Etcd, err error) {
|
||||
autoCompactionRetention time.Duration
|
||||
h int
|
||||
)
|
||||
// AutoCompactionRetention defaults to "0" if not set.
|
||||
if len(cfg.AutoCompactionRetention) == 0 {
|
||||
cfg.AutoCompactionRetention = "0"
|
||||
}
|
||||
h, err = strconv.Atoi(cfg.AutoCompactionRetention)
|
||||
if err == nil {
|
||||
autoCompactionRetention = time.Duration(int64(h)) * time.Hour
|
||||
|
Loading…
x
Reference in New Issue
Block a user