From 32c282ca10ba53d0fd2e923caf457ab4febf206c Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Wed, 27 Dec 2023 11:38:10 +0300 Subject: [PATCH] [#569] writecache: Refactor flush Make single RUnlock call instead of two. Signed-off-by: Dmitrii Stepanov --- pkg/local_object_storage/writecache/flush.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/local_object_storage/writecache/flush.go b/pkg/local_object_storage/writecache/flush.go index 17dcc110..c4e4b3b3 100644 --- a/pkg/local_object_storage/writecache/flush.go +++ b/pkg/local_object_storage/writecache/flush.go @@ -138,13 +138,11 @@ func (c *cache) flushSmallObjects(ctx context.Context) { } } + c.modeMtx.RUnlock() if count == 0 { - c.modeMtx.RUnlock() break } - c.modeMtx.RUnlock() - c.log.Debug(logs.WritecacheTriedToFlushItemsFromWritecache, zap.Int("count", count), zap.String("start", base58.Encode(lastKey)))