mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Don't delete files if retention duration is 0
This commit is contained in:
parent
9c76624df2
commit
987a90d149
3
db.go
3
db.go
|
@ -292,6 +292,9 @@ func (db *DB) compact(i, j int) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *DB) retentionCutoff() error {
|
func (db *DB) retentionCutoff() error {
|
||||||
|
if db.opts.RetentionDuration == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
h := db.heads[len(db.heads)-1]
|
h := db.heads[len(db.heads)-1]
|
||||||
t := h.meta.MinTime - int64(db.opts.RetentionDuration)
|
t := h.meta.MinTime - int64(db.opts.RetentionDuration)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue