1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-28 00:39:31 +08:00

feat(routingd) lose the mutex. the S3 datastore is threadsafe

This commit is contained in:
Brian Tiger Chow
2015-02-15 04:45:39 -08:00
parent bbcf4e23b1
commit bbcc824f8e

View File

@ -14,7 +14,6 @@ import (
s3 "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/crowdmob/goamz/s3" s3 "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/crowdmob/goamz/s3"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/fzzy/radix/redis" "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/fzzy/radix/redis"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore" "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore"
syncds "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync"
core "github.com/jbenet/go-ipfs/core" core "github.com/jbenet/go-ipfs/core"
corerouting "github.com/jbenet/go-ipfs/core/corerouting" corerouting "github.com/jbenet/go-ipfs/core/corerouting"
config "github.com/jbenet/go-ipfs/repo/config" config "github.com/jbenet/go-ipfs/repo/config"
@ -145,7 +144,7 @@ func makeS3Datastore() (*s3datastore.S3Datastore, error) {
}, nil }, nil
} }
func enhanceDatastore(d datastore.Datastore) (datastore.ThreadSafeDatastore, error) { func enhanceDatastore(d datastore.ThreadSafeDatastore) (datastore.ThreadSafeDatastore, error) {
// TODO cache // TODO cache
return ds2.CloserWrap(syncds.MutexWrap(d)), nil return ds2.CloserWrap(d), nil
} }