Skip to content

Commit c04c6b4

Browse files
committed
fix(pkg/server): added os file separator and db root path
1 parent 84fbb95 commit c04c6b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: pkg/server/server.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,10 @@ func (s *ImmuServer) loadUserDatabases(dataDir string) error {
367367
for _, val := range dirs {
368368
//dbname is the directory name where it is stored
369369
//path iteration above stores the directories as data/db_name
370-
pathparts := strings.Split(val, "/")
370+
pathparts := strings.Split(val, string(filepath.Separator))
371371
dbname := pathparts[len(pathparts)-1]
372-
op := DefaultOption().WithDbName(dbname).WithCorruptionChecker(s.Options.CorruptionCheck).WithDbRootPath(s.Options.Dir)
372+
op := DefaultOption().WithDbName(dbname).WithDbRootPath(dataDir).
373+
WithCorruptionChecker(s.Options.CorruptionCheck).WithDbRootPath(s.Options.Dir)
373374
db, err := OpenDb(op, s.Logger)
374375
if err != nil {
375376
return err

0 commit comments

Comments
 (0)