mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-16 04:00:38 +03:00
Save Storm DB in the DbPath configured
This commit is contained in:
parent
cead8906d6
commit
c9742181ff
@ -4,6 +4,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/cloudsonic/sonic-server/conf"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
"github.com/siddontang/ledisdb/config"
|
||||
"github.com/siddontang/ledisdb/ledis"
|
||||
)
|
||||
@ -18,6 +19,7 @@ func Db() *ledis.DB {
|
||||
once.Do(func() {
|
||||
config := config.NewConfigDefault()
|
||||
config.DataDir = conf.Sonic.DbPath
|
||||
log.Debug("Opening LedisDB from: " + conf.Sonic.DbPath)
|
||||
l, _ := ledis.Open(config)
|
||||
instance, err := l.Select(0)
|
||||
if err != nil {
|
||||
|
@ -1,9 +1,12 @@
|
||||
package db_storm
|
||||
|
||||
import (
|
||||
"path"
|
||||
"sync"
|
||||
|
||||
"github.com/asdine/storm"
|
||||
"github.com/cloudsonic/sonic-server/conf"
|
||||
"github.com/cloudsonic/sonic-server/log"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -13,7 +16,9 @@ var (
|
||||
|
||||
func Db() *storm.DB {
|
||||
once.Do(func() {
|
||||
instance, err := storm.Open("./storm.db")
|
||||
dbPath := path.Join(conf.Sonic.DbPath, "storm.db")
|
||||
instance, err := storm.Open(dbPath)
|
||||
log.Debug("Opening Storm DB from: " + dbPath)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user