From 54329870303009b34996e585826c1f6128a4537e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 29 Oct 2019 19:04:35 +0100 Subject: [PATCH] repo: enable badger log truncation --- node/repo/fsrepo.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/node/repo/fsrepo.go b/node/repo/fsrepo.go index e799883c5..df496315c 100644 --- a/node/repo/fsrepo.go +++ b/node/repo/fsrepo.go @@ -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") }*/