[#1414] metabase: Check parameter for CountAliveObjectsInBucket
All checks were successful
DCO action / DCO (pull_request) Successful in 49s
Tests and linters / Run gofumpt (pull_request) Successful in 44s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m58s
Build / Build Components (pull_request) Successful in 2m3s
Vulncheck / Vulncheck (pull_request) Successful in 1m58s
Tests and linters / Staticcheck (pull_request) Successful in 2m20s
Tests and linters / gopls check (pull_request) Successful in 3m10s
Tests and linters / Tests (pull_request) Successful in 3m16s
Tests and linters / Lint (pull_request) Successful in 3m29s
Tests and linters / Tests with -race (pull_request) Successful in 4m20s
All checks were successful
DCO action / DCO (pull_request) Successful in 49s
Tests and linters / Run gofumpt (pull_request) Successful in 44s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m58s
Build / Build Components (pull_request) Successful in 2m3s
Vulncheck / Vulncheck (pull_request) Successful in 1m58s
Tests and linters / Staticcheck (pull_request) Successful in 2m20s
Tests and linters / gopls check (pull_request) Successful in 3m10s
Tests and linters / Tests (pull_request) Successful in 3m16s
Tests and linters / Lint (pull_request) Successful in 3m29s
Tests and linters / Tests with -race (pull_request) Successful in 4m20s
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
9a87acb87a
commit
085c9921d2
1 changed files with 3 additions and 2 deletions
|
@ -452,10 +452,11 @@ func (db *DB) CountAliveObjectsInBucket(ctx context.Context, prm CountAliveObjec
|
|||
return 0, ErrDegradedMode
|
||||
}
|
||||
|
||||
cidRaw := prm.BucketName[1:bucketKeySize]
|
||||
if cidRaw == nil {
|
||||
if len(prm.BucketName) != bucketKeySize {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
cidRaw := prm.BucketName[1:bucketKeySize]
|
||||
var count uint64
|
||||
err := db.boltDB.View(func(tx *bbolt.Tx) error {
|
||||
bkt := tx.Bucket(prm.BucketName)
|
||||
|
|
Loading…
Reference in a new issue