[#472] blobstor: use DB.Batch() for metabase and blobstor

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-04-09 12:18:38 +03:00 committed by Alex Vanin
parent 934e394e28
commit 828c8695c1
2 changed files with 2 additions and 2 deletions

View file

@ -51,7 +51,7 @@ func (b *Blobovnicza) Put(prm *PutPrm) (*PutRes, error) {
return nil, errNilAddress
}
err := b.boltDB.Update(func(tx *bbolt.Tx) error {
err := b.boltDB.Batch(func(tx *bbolt.Tx) error {
if b.full() {
return ErrFull
}

View file

@ -67,7 +67,7 @@ func Put(db *DB, obj *object.Object, id *blobovnicza.ID) error {
// Put saves object header in metabase. Object payload expected to be cut.
// Big objects have nil blobovniczaID.
func (db *DB) Put(prm *PutPrm) (res *PutRes, err error) {
err = db.boltDB.Update(func(tx *bbolt.Tx) error {
err = db.boltDB.Batch(func(tx *bbolt.Tx) error {
return db.put(tx, prm.obj, prm.id, nil)
})