Fix timing on database root path initialization

This commit is contained in:
Daniel
2025-02-26 13:23:38 +01:00
parent 4721e58727
commit 130c4a427c
4 changed files with 10 additions and 14 deletions

View File

@@ -5,7 +5,6 @@ import (
"sync/atomic"
"github.com/safing/portmaster/base/database"
"github.com/safing/portmaster/base/dataroot"
"github.com/safing/portmaster/base/utils"
"github.com/safing/portmaster/service/mgr"
)
@@ -36,13 +35,7 @@ func SetDatabaseLocation(dirStructureRoot *utils.DirStructure) {
}
}
// GetDatabaseLocation returns the initialized database location.
func GetDatabaseLocation() string {
return databaseStructureRoot.Path
}
func prep() error {
SetDatabaseLocation(dataroot.Root())
if databaseStructureRoot == nil {
return errors.New("database location not specified")
}