[#863] blobovnicza: Fix counters
Vulncheck / Vulncheck (pull_request) Successful in 2m27s Details
DCO action / DCO (pull_request) Successful in 2m39s Details
Build / Build Components (1.21) (pull_request) Successful in 3m38s Details
Build / Build Components (1.20) (pull_request) Successful in 3m45s Details
Tests and linters / Staticcheck (pull_request) Successful in 4m15s Details
Tests and linters / Lint (pull_request) Successful in 5m47s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 11m49s Details
Tests and linters / Tests (1.21) (pull_request) Successful in 12m16s Details
Tests and linters / Tests with -race (pull_request) Successful in 12m31s Details

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
pull/865/head
Dmitrii Stepanov 2023-12-13 13:34:29 +03:00
parent 11add38e87
commit 7eb46404a1
1 changed files with 6 additions and 5 deletions

View File

@ -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)
}