Skip to content

Commit

Permalink
TSDB: use blocks instead of db.blocks in condition (#8068)
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
  • Loading branch information
roidelapluie committed Oct 19, 2020
1 parent 5de7d15 commit 59733b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tsdb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ func deletableBlocks(db *DB, blocks []*Block) map[ulid.ULID]struct{} {
// set in the db options.
func BeyondTimeRetention(db *DB, blocks []*Block) (deletable map[ulid.ULID]struct{}) {
// 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
}

Expand All @@ -1100,7 +1100,7 @@ func BeyondTimeRetention(db *DB, blocks []*Block) (deletable map[ulid.ULID]struc
// set in the db options.
func BeyondSizeRetention(db *DB, blocks []*Block) (deletable map[ulid.ULID]struct{}) {
// 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
}

Expand Down

0 comments on commit 59733b1

Please sign in to comment.