forked from TrueCloudLab/frostfs-node
[#1414] metabase: Check parameter for CountAliveObjectsInBucket
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
4dc9a1b300
commit
2f710d8f94
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
|
return 0, ErrDegradedMode
|
||||||
}
|
}
|
||||||
|
|
||||||
cidRaw := prm.BucketName[1:bucketKeySize]
|
if len(prm.BucketName) != bucketKeySize {
|
||||||
if cidRaw == nil {
|
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cidRaw := prm.BucketName[1:bucketKeySize]
|
||||||
var count uint64
|
var count uint64
|
||||||
err := db.boltDB.View(func(tx *bbolt.Tx) error {
|
err := db.boltDB.View(func(tx *bbolt.Tx) error {
|
||||||
bkt := tx.Bucket(prm.BucketName)
|
bkt := tx.Bucket(prm.BucketName)
|
||||||
|
|
Loading…
Reference in a new issue