File tree 2 files changed +3
-2
lines changed 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
10
10
11
11
ds "github.com/ipfs/go-datastore"
12
12
"github.com/ipfs/go-datastore/mount"
13
+ dssync "github.com/ipfs/go-datastore/sync"
13
14
"github.com/ipfs/go-ds-measure"
14
15
)
15
16
@@ -174,7 +175,7 @@ func (c *memDatastoreConfig) DiskSpec() DiskSpec {
174
175
}
175
176
176
177
func (c * memDatastoreConfig ) Create (string ) (repo.Datastore , error ) {
177
- return ds .NewMapDatastore (), nil
178
+ return dssync . MutexWrap ( ds .NewMapDatastore () ), nil
178
179
}
179
180
180
181
type logDatastoreConfig struct {
Original file line number Diff line number Diff line change @@ -59,5 +59,5 @@ type Repo interface {
59
59
// Datastore is the interface required from a datastore to be
60
60
// acceptable to FSRepo.
61
61
type Datastore interface {
62
- ds.Batching // should be threadsafe, just be careful
62
+ ds.Batching // must be thread-safe
63
63
}
You can’t perform that action at this time.
0 commit comments