From 8ec16fa2e51ed943d372dd566b22ce6099ead24b Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 20 Aug 2018 21:49:08 -0700 Subject: [PATCH] always truncate when SyncWrites is enabled This will delete values that were in the process of being "put" when we crashed but that's likely expected behavior anyways. Without this, ipfs on badger may refuse to start after a crash. --- datastore.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datastore.go b/datastore.go index 3555da4..72ed770 100644 --- a/datastore.go +++ b/datastore.go @@ -53,7 +53,7 @@ func NewDatastore(path string, options *Options) (*Datastore, error) { gcDiscardRatio = options.gcDiscardRatio } - if osh.IsWindows() && opt.SyncWrites { + if opt.SyncWrites { opt.Truncate = true }