Don't delete files if retention duration is 0

This commit is contained in:
Fabian Reinartz 2017-02-11 11:49:17 -08:00
parent 9c76624df2
commit 987a90d149
1 changed files with 3 additions and 0 deletions

3
db.go
View File

@ -292,6 +292,9 @@ func (db *DB) compact(i, j int) error {
}
func (db *DB) retentionCutoff() error {
if db.opts.RetentionDuration == 0 {
return nil
}
h := db.heads[len(db.heads)-1]
t := h.meta.MinTime - int64(db.opts.RetentionDuration)