File tree 4 files changed +146
-154
lines changed
4 files changed +146
-154
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"
@@ -128,22 +129,26 @@ var _ ds.Batching = (*Datastore)(nil)
128
129
// NewDatastore creates a new badger datastore.
129
130
//
130
131
// DO NOT set the Dir and/or ValuePath fields of opt, they will be set for you.
131
- func NewDatastore (path string , options * Options ) (* Datastore , error ) {
132
+ func NewDatastore (path string , opts * Options ) (* Datastore , error ) {
132
133
// Copy the options because we modify them.
133
134
var opt badger.Options
134
135
var gcDiscardRatio float64
135
136
var gcSleep time.Duration
136
137
var gcInterval time.Duration
137
- if options == nil {
138
+ if opts == nil {
138
139
opt = badger .DefaultOptions ("" )
139
140
gcDiscardRatio = DefaultOptions .GcDiscardRatio
140
141
gcSleep = DefaultOptions .GcSleep
141
142
gcInterval = DefaultOptions .GcInterval
142
143
} else {
143
- opt = options .Options
144
- gcDiscardRatio = options .GcDiscardRatio
145
- gcSleep = options .GcSleep
146
- gcInterval = options .GcInterval
144
+ opt = opts .Options
145
+ gcDiscardRatio = opts .GcDiscardRatio
146
+ gcSleep = opts .GcSleep
147
+ gcInterval = opts .GcInterval
148
+ }
149
+
150
+ if os .Getenv ("GOARCH" ) == "386" {
151
+ opt .TableLoadingMode = options .FileIO
147
152
}
148
153
149
154
if gcSleep <= 0 {
You can’t perform that action at this time.
0 commit comments