mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 21:54:10 -08:00
TSDB: use blocks
instead of db.blocks in condition (#8068)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
parent
5de7d15879
commit
59733b1a26
|
@ -1077,7 +1077,7 @@ func deletableBlocks(db *DB, blocks []*Block) map[ulid.ULID]struct{} {
|
||||||
// set in the db options.
|
// set in the db options.
|
||||||
func BeyondTimeRetention(db *DB, blocks []*Block) (deletable map[ulid.ULID]struct{}) {
|
func BeyondTimeRetention(db *DB, blocks []*Block) (deletable map[ulid.ULID]struct{}) {
|
||||||
// Time retention is disabled or no blocks to work with.
|
// Time retention is disabled or no blocks to work with.
|
||||||
if len(db.blocks) == 0 || db.opts.RetentionDuration == 0 {
|
if len(blocks) == 0 || db.opts.RetentionDuration == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1100,7 +1100,7 @@ func BeyondTimeRetention(db *DB, blocks []*Block) (deletable map[ulid.ULID]struc
|
||||||
// set in the db options.
|
// set in the db options.
|
||||||
func BeyondSizeRetention(db *DB, blocks []*Block) (deletable map[ulid.ULID]struct{}) {
|
func BeyondSizeRetention(db *DB, blocks []*Block) (deletable map[ulid.ULID]struct{}) {
|
||||||
// Size retention is disabled or no blocks to work with.
|
// Size retention is disabled or no blocks to work with.
|
||||||
if len(db.blocks) == 0 || db.opts.MaxBytes <= 0 {
|
if len(blocks) == 0 || db.opts.MaxBytes <= 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue