Fix various issues during portmaster development

This commit is contained in:
Daniel 2019-01-24 15:23:35 +01:00
parent a943e3315f
commit 358e684909
5 changed files with 92 additions and 41 deletions

View file

@ -15,10 +15,18 @@ var (
shutdownSignal = make(chan struct{})
)
// Initialize initialized the database
func Initialize(location string) error {
if initialized.SetToIf(false, true) {
// SetLocation sets the location of the database. This is separate from the initialization to provide the location to other modules earlier.
func SetLocation(location string) (ok bool) {
if !initialized.IsSet() && rootDir == "" {
rootDir = location
return true
}
return false
}
// Initialize initialized the database
func Initialize() error {
if initialized.SetToIf(false, true) {
err := ensureDirectory(rootDir)
if err != nil {