Skip to content

Commit

Permalink
stats: imp logging
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Aug 19, 2022
1 parent 257d167 commit 09a732a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,12 @@ func (s *StatsCtx) flush() (cont bool, sleepFor time.Duration) {

derr := tx.DeleteBucket(idToUnitName(id - limit))
if derr != nil {
log.Error("stats: deleting unit: %s", derr)
logFunc := log.Error
if !errors.Is(derr, bbolt.ErrBucketNotFound) {
isCommitable = false
logFunc = log.Debug
}
logFunc("stats: deleting unit: %s", derr)
}

err = finishTxn(tx, isCommitable)
Expand Down

0 comments on commit 09a732a

Please sign in to comment.