mirror of
https://github.com/safing/portbase
synced 2025-09-17 02:29:50 +00:00
Move DB record maintenance to storage interface
This commit is contained in:
parent
4eb21405cc
commit
bea130d755
16 changed files with 385 additions and 224 deletions
|
@ -2,11 +2,13 @@
|
|||
package bbolt
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"reflect"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/safing/portbase/database/query"
|
||||
"github.com/safing/portbase/database/record"
|
||||
|
@ -144,11 +146,15 @@ func TestBBolt(t *testing.T) {
|
|||
}
|
||||
|
||||
// maintenance
|
||||
err = db.Maintain()
|
||||
err = db.Maintain(context.TODO())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
err = db.MaintainThorough()
|
||||
err = db.MaintainThorough(context.TODO())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
err = db.MaintainRecordStates(context.TODO(), time.Now())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue