From feef9a98f78723a7f13e0a11d353bce205abcb23 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 2 Jun 2022 20:39:40 +0300 Subject: [PATCH] [#1462] writecache: remove useless logs Signed-off-by: Evgenii Stratonikov --- pkg/local_object_storage/writecache/flush.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/local_object_storage/writecache/flush.go b/pkg/local_object_storage/writecache/flush.go index 62a16d62c..074f2cf97 100644 --- a/pkg/local_object_storage/writecache/flush.go +++ b/pkg/local_object_storage/writecache/flush.go @@ -106,6 +106,11 @@ func (c *cache) flush() { } } + if len(m) == 0 { + c.modeMtx.RUnlock() + break + } + c.evictObjects(len(m)) for i := range m { c.flushed.Add(m[i].addr, true) @@ -115,12 +120,6 @@ func (c *cache) flush() { c.log.Debug("flushed items from write-cache", zap.Int("count", len(m)), zap.String("start", base58.Encode(lastKey))) - - if len(m) > 0 { - lastKey = append([]byte(m[len(m)-1].addr), 0) - } else { - break - } } }