Skip to content

Commit

Permalink
fix checks
Browse files Browse the repository at this point in the history
  • Loading branch information
laktak committed Dec 20, 2024
1 parent 402915f commit b2269fc
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions store.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,20 @@ func (s *store) Open(readOnly bool) error {

if s.refreshDb {
err = clearFile(s.newFile)
if err != nil {
return err
}
} else {
err = copyFile(s.dbFile, s.newFile)
}
if err != nil {
return err
}

s.connW, err = bolt.Open(s.newFile, 0600, optW)
err = s.connW.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists([]byte("data"))
return err
})
if err == nil {
err = s.connW.Update(func(tx *bolt.Tx) error {
_, err := tx.CreateBucketIfNotExists([]byte("data"))
return err
})
}
}
}
return err
Expand Down

0 comments on commit b2269fc

Please sign in to comment.