forked from TrueCloudLab/frostfs-node
[#472] blobstor: use DB.Batch()
for metabase and blobstor
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
934e394e28
commit
828c8695c1
2 changed files with 2 additions and 2 deletions
|
@ -51,7 +51,7 @@ func (b *Blobovnicza) Put(prm *PutPrm) (*PutRes, error) {
|
||||||
return nil, errNilAddress
|
return nil, errNilAddress
|
||||||
}
|
}
|
||||||
|
|
||||||
err := b.boltDB.Update(func(tx *bbolt.Tx) error {
|
err := b.boltDB.Batch(func(tx *bbolt.Tx) error {
|
||||||
if b.full() {
|
if b.full() {
|
||||||
return ErrFull
|
return ErrFull
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
// Put saves object header in metabase. Object payload expected to be cut.
|
||||||
// Big objects have nil blobovniczaID.
|
// Big objects have nil blobovniczaID.
|
||||||
func (db *DB) Put(prm *PutPrm) (res *PutRes, err error) {
|
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)
|
return db.put(tx, prm.obj, prm.id, nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue