mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-02 03:28:25 +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 (
|
||||
defaultDataStoreDirectory = "datastore"
|
||||
leveldbDirectory = "datastore"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -190,8 +190,8 @@ func Init(repoPath string, conf *config.Config) error {
|
||||
|
||||
// The actual datastore contents are initialized lazily when Opened.
|
||||
// During Init, we merely check that the directory is writeable.
|
||||
p := path.Join(repoPath, defaultDataStoreDirectory)
|
||||
if err := dir.Writable(p); err != nil {
|
||||
leveldbPath := path.Join(repoPath, leveldbDirectory)
|
||||
if err := dir.Writable(leveldbPath); err != nil {
|
||||
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.
|
||||
func (r *FSRepo) openDatastore() error {
|
||||
dsPath := path.Join(r.path, defaultDataStoreDirectory)
|
||||
ds, err := levelds.NewDatastore(dsPath, &levelds.Options{
|
||||
leveldbPath := path.Join(r.path, leveldbDirectory)
|
||||
ds, err := levelds.NewDatastore(leveldbPath, &levelds.Options{
|
||||
Compression: ldbopts.NoCompression,
|
||||
})
|
||||
if err != nil {
|
||||
@ -430,7 +430,7 @@ func isInitializedUnsynced(repoPath string) bool {
|
||||
if !configIsInitialized(repoPath) {
|
||||
return false
|
||||
}
|
||||
if !util.FileExists(path.Join(repoPath, defaultDataStoreDirectory)) {
|
||||
if !util.FileExists(path.Join(repoPath, leveldbDirectory)) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
Reference in New Issue
Block a user