lib/db: Remove Badger experiment (#7413)

This commit is contained in:
Jakob Borg
2021-03-01 09:16:08 +01:00
committed by GitHub
parent cca17f5306
commit 55d5e03639
7 changed files with 1 additions and 638 deletions
-8
View File
@@ -47,7 +47,6 @@ const (
UserHomeBaseDir BaseDirEnum = "userHome"
LevelDBDir = "index-v0.14.0.db"
BadgerDir = "indexdb.badger"
)
// Platform dependent directories
@@ -160,16 +159,9 @@ func defaultDataDir(userHome, config string) string {
default:
// If a database exists at the "normal" location, use that anyway.
// We look for both LevelDB and Badger variants here regardless of
// what we're currently configured to use, because we might be
// starting up in Badger mode with only a LevelDB database present
// (will be converted), or vice versa.
if _, err := os.Lstat(filepath.Join(config, LevelDBDir)); err == nil {
return config
}
if _, err := os.Lstat(filepath.Join(config, BadgerDir)); err == nil {
return config
}
// Always use this env var, as it's explicitly set by the user
if xdgHome := os.Getenv("XDG_DATA_HOME"); xdgHome != "" {
return filepath.Join(xdgHome, "syncthing")