Skip to content

Commit

Permalink
embed: fix revision-based compaction with default value
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
  • Loading branch information
gyuho committed Feb 21, 2018
1 parent 74279c7 commit 6ab320d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion embed/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,14 @@ func StartEtcd(inCfg *Config) (e *Etcd, err error) {
}
h, err = strconv.Atoi(cfg.AutoCompactionRetention)
if err == nil {
autoCompactionRetention = time.Duration(int64(h)) * time.Hour
switch cfg.AutoCompactionMode {
case CompactorModeRevision:
autoCompactionRetention = time.Duration(int64(h))
case CompactorModePeriodic:
autoCompactionRetention = time.Duration(int64(h)) * time.Hour
}
} else {
// periodic compaction
autoCompactionRetention, err = time.ParseDuration(cfg.AutoCompactionRetention)
if err != nil {
return nil, fmt.Errorf("error parsing AutoCompactionRetention: %v", err)
Expand Down

0 comments on commit 6ab320d

Please sign in to comment.