multi: add AutoCompact option to bolt backend

With this commit we thread the new AutoCompact flags all the way through
to the bolt backend.
This commit is contained in:
Oliver Gugger
2020-11-09 10:21:25 +01:00
parent 6131a53eb4
commit f8907fdb47
5 changed files with 85 additions and 20 deletions

View File

@@ -83,9 +83,13 @@ func (db *DB) GetBackends(ctx context.Context, dbPath string,
}
}
localDB, err = kvdb.GetBoltBackend(
dbPath, dbName, !db.Bolt.SyncFreelist,
)
localDB, err = kvdb.GetBoltBackend(&kvdb.BoltBackendConfig{
DBPath: dbPath,
DBFileName: dbName,
NoFreelistSync: !db.Bolt.SyncFreelist,
AutoCompact: db.Bolt.AutoCompact,
AutoCompactMinAge: db.Bolt.AutoCompactMinAge,
})
if err != nil {
return nil, err
}