From 0c7adc72740114eb7ae0105199ccbdbfabf8f9fe Mon Sep 17 00:00:00 2001 From: Eugene Burkov Date: Mon, 22 Aug 2022 14:12:01 +0300 Subject: [PATCH] stats: fix err check --- internal/stats/stats.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/stats/stats.go b/internal/stats/stats.go index f4bbbea3c0b..aea6d92dcb1 100644 --- a/internal/stats/stats.go +++ b/internal/stats/stats.go @@ -410,10 +410,10 @@ func (s *StatsCtx) flush() (cont bool, sleepFor time.Duration) { if delErr != nil { // TODO(e.burkov): Improve the algorithm of deleting the oldest bucket // to avoid the error. - if !errors.Is(delErr, bbolt.ErrBucketNotFound) { - isCommitable = false + if errors.Is(delErr, bbolt.ErrBucketNotFound) { log.Debug("stats: warning: deleting unit: %s", delErr) } else { + isCommitable = false log.Error("stats: deleting unit: %s", delErr) } }