mirror of
https://github.com/safing/portbase
synced 2025-09-14 09:09:50 +00:00
Fix various issues during portmaster development
This commit is contained in:
parent
a943e3315f
commit
358e684909
5 changed files with 92 additions and 41 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue