mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-03 21:08:17 +08:00
LevelDB is no longer "the" datastore, adjust identifiers
This commit is contained in:

committed by
Juan Batiz-Benet

parent
7eb4a92aba
commit
5cb8d80bb6
@ -25,7 +25,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
defaultDataStoreDirectory = "datastore"
|
leveldbDirectory = "datastore"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -190,8 +190,8 @@ func Init(repoPath string, conf *config.Config) error {
|
|||||||
|
|
||||||
// The actual datastore contents are initialized lazily when Opened.
|
// The actual datastore contents are initialized lazily when Opened.
|
||||||
// During Init, we merely check that the directory is writeable.
|
// During Init, we merely check that the directory is writeable.
|
||||||
p := path.Join(repoPath, defaultDataStoreDirectory)
|
leveldbPath := path.Join(repoPath, leveldbDirectory)
|
||||||
if err := dir.Writable(p); err != nil {
|
if err := dir.Writable(leveldbPath); err != nil {
|
||||||
return fmt.Errorf("datastore: %s", err)
|
return fmt.Errorf("datastore: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,8 +236,8 @@ func (r *FSRepo) openConfig() error {
|
|||||||
|
|
||||||
// openDatastore returns an error if the config file is not present.
|
// openDatastore returns an error if the config file is not present.
|
||||||
func (r *FSRepo) openDatastore() error {
|
func (r *FSRepo) openDatastore() error {
|
||||||
dsPath := path.Join(r.path, defaultDataStoreDirectory)
|
leveldbPath := path.Join(r.path, leveldbDirectory)
|
||||||
ds, err := levelds.NewDatastore(dsPath, &levelds.Options{
|
ds, err := levelds.NewDatastore(leveldbPath, &levelds.Options{
|
||||||
Compression: ldbopts.NoCompression,
|
Compression: ldbopts.NoCompression,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -430,7 +430,7 @@ func isInitializedUnsynced(repoPath string) bool {
|
|||||||
if !configIsInitialized(repoPath) {
|
if !configIsInitialized(repoPath) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if !util.FileExists(path.Join(repoPath, defaultDataStoreDirectory)) {
|
if !util.FileExists(path.Join(repoPath, leveldbDirectory)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
Reference in New Issue
Block a user