Skip to content

Commit

Permalink
address coment
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinxie committed Dec 15, 2024
1 parent 5f4539f commit 6208429
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions db/db_versioned.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,7 @@ func (b *BoltDBVersioned) commitToDB(version uint64, vnsize map[string]int, ve,
// get bucket
bucket, ok := buckets[ns]
if !ok {
bucket, err = tx.CreateBucketIfNotExists([]byte(ns))
if err != nil {
return errors.Wrapf(err, "failed to create bucket %s", ns)
}
buckets[ns] = bucket
panic(fmt.Sprintf("BoltDBVersioned.commitToDB(), vns = %s does not exist", ns))
}
// check key's last version
var (
Expand All @@ -286,7 +282,7 @@ func (b *BoltDBVersioned) commitToDB(version uint64, vnsize map[string]int, ve,
switch write.WriteType() {
case batch.Put:
if bytes.Equal(key, _minKey) {
// create namespace
// create metadata for namespace
if err = bucket.Put(key, val); err != nil {
return errors.Wrap(err, write.Error())
}
Expand Down

0 comments on commit 6208429

Please sign in to comment.