From e39db63827d81b7ba20b6936cadade552d43bbd6 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Wed, 13 Dec 2023 13:34:29 +0300 Subject: [PATCH] [#863] blobovnicza: Fix counters Signed-off-by: Dmitrii Stepanov --- pkg/local_object_storage/blobovnicza/meta.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/local_object_storage/blobovnicza/meta.go b/pkg/local_object_storage/blobovnicza/meta.go index 8b913f8a7..3316d4666 100644 --- a/pkg/local_object_storage/blobovnicza/meta.go +++ b/pkg/local_object_storage/blobovnicza/meta.go @@ -92,12 +92,13 @@ func updateMeta(tx *bbolt.Tx, updateValues func(count, size uint64) (uint64, uin count, size = updateValues(count, size) - buf := make([]byte, dataSizeAndItemsCountBufLength) - binary.LittleEndian.PutUint64(buf, size) - if err := b.Put(dataSizeKey, buf); err != nil { + sizeBuf := make([]byte, dataSizeAndItemsCountBufLength) + binary.LittleEndian.PutUint64(sizeBuf, size) + if err := b.Put(dataSizeKey, sizeBuf); err != nil { return err } - binary.LittleEndian.PutUint64(buf, count) - return b.Put(itemsCountKey, buf) + countBuf := make([]byte, dataSizeAndItemsCountBufLength) + binary.LittleEndian.PutUint64(countBuf, count) + return b.Put(itemsCountKey, countBuf) }