created bucket if not exists during restore sequence (#6614)

pull/6619/head
Prabhat Khera 3 years ago committed by GitHub
parent a3b1466b96
commit eb6cdf1229
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -419,9 +419,9 @@ func (connection *DbConnection) RestoreMetadata(s map[string]interface{}) error
}
err = connection.Batch(func(tx *bolt.Tx) error {
bucket := tx.Bucket([]byte(bucketName))
if bucket == nil {
return nil
bucket, err := tx.CreateBucketIfNotExists([]byte(bucketName))
if err != nil {
return err
}
return bucket.SetSequence(uint64(id))
})

Loading…
Cancel
Save