Merge pull request #492 from filecoin-project/feat/badger-truncate

repo: Enable badger log truncation
This commit is contained in:
Łukasz Magiera 2019-10-29 19:09:18 +01:00 committed by GitHub
commit 28e91bfa88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -205,7 +205,10 @@ func (fsr *fsLockedRepo) stillValid() error {
func (fsr *fsLockedRepo) Datastore(ns string) (datastore.Batching, error) {
fsr.dsOnce.Do(func() {
fsr.ds, fsr.dsErr = badger.NewDatastore(fsr.join(fsDatastore), nil)
opts := badger.DefaultOptions
opts.Truncate = true
fsr.ds, fsr.dsErr = badger.NewDatastore(fsr.join(fsDatastore), &opts)
/*if fsr.dsErr == nil {
fsr.ds = datastore.NewLogDatastore(fsr.ds, "fsrepo")
}*/