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

pull/6619/head
Prabhat Khera 2022-03-03 09:10:26 +13:00 committed by GitHub
parent a3b1466b96
commit eb6cdf1229
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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))
})