File tree 2 files changed +8
-9
lines changed
2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 4
4
"context"
5
5
"errors"
6
6
"fmt"
7
+ "os"
7
8
"runtime"
8
9
"strings"
9
10
"sync"
@@ -107,8 +108,12 @@ func init() {
107
108
// reading (in some tests).
108
109
DefaultOptions .Options .ValueLogLoadingMode = options .FileIO
109
110
110
- // Explicitly set this to mmap. This doesn't use much memory anyways.
111
- DefaultOptions .Options .TableLoadingMode = options .MemoryMap
111
+ if os .Getenv ("GOARCH" ) == "386" {
112
+ DefaultOptions .Options .TableLoadingMode = options .FileIO
113
+ } else {
114
+ // Explicitly set this to mmap. This doesn't use much memory anyways.
115
+ DefaultOptions .Options .TableLoadingMode = options .MemoryMap
116
+ }
112
117
113
118
// Reduce this from 64MiB to 16MiB. That means badger will hold on to
114
119
// 20MiB by default instead of 80MiB.
Original file line number Diff line number Diff line change @@ -5,12 +5,10 @@ import (
5
5
"context"
6
6
"crypto/rand"
7
7
"fmt"
8
- "os"
9
8
"sort"
10
9
"testing"
11
10
"time"
12
11
13
- options "github.com/dgraph-io/badger/options"
14
12
ds "github.com/ipfs/go-datastore"
15
13
dsq "github.com/ipfs/go-datastore/query"
16
14
dstest "github.com/ipfs/go-datastore/test"
@@ -634,11 +632,7 @@ func TestDiskUsage(t *testing.T) {
634
632
addTestCases (t , d , testcases )
635
633
d .Close ()
636
634
637
- dsOpts := DefaultOptions
638
- if os .Getenv ("GOARCH" ) == "386" {
639
- dsOpts .Options .TableLoadingMode = options .FileIO
640
- }
641
- d , err = NewDatastore (path , & dsOpts )
635
+ d , err = NewDatastore (path , nil )
642
636
if err != nil {
643
637
t .Fatal (err )
644
638
}
You can’t perform that action at this time.
0 commit comments