mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 17:44:35 +03:00
add debug logging about bstore db schema upgrades
bstore was updated to v0.0.6 to add this logging. this simplifies some of the db-handling code in mtastsdb,tlsrptdb,dmarcdb. we now call the package-level Init() and Close() in all tests properly.
This commit is contained in:
@ -907,7 +907,8 @@ func OpenAccountDB(log mlog.Log, accountDir, accountName string) (a *Account, re
|
||||
os.MkdirAll(accountDir, 0770)
|
||||
}
|
||||
|
||||
db, err := bstore.Open(context.TODO(), dbpath, &bstore.Options{Timeout: 5 * time.Second, Perm: 0660}, DBTypes...)
|
||||
opts := bstore.Options{Timeout: 5 * time.Second, Perm: 0660, RegisterLogger: log.Logger}
|
||||
db, err := bstore.Open(context.TODO(), dbpath, &opts, DBTypes...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -121,7 +121,8 @@ func TestThreadingUpgrade(t *testing.T) {
|
||||
|
||||
// Now clear the threading upgrade, and the threading fields and close the account.
|
||||
// We open the database file directly, so we don't trigger the consistency checker.
|
||||
db, err := bstore.Open(ctxbg, dbpath, &bstore.Options{Timeout: 5 * time.Second, Perm: 0660}, DBTypes...)
|
||||
opts := bstore.Options{Timeout: 5 * time.Second, Perm: 0660, RegisterLogger: log.Logger}
|
||||
db, err := bstore.Open(ctxbg, dbpath, &opts, DBTypes...)
|
||||
err = db.Write(ctxbg, func(tx *bstore.Tx) error {
|
||||
up := Upgrade{ID: 1}
|
||||
err := tx.Delete(&up)
|
||||
|
Reference in New Issue
Block a user