This commit is contained in:
parent
b87c0bff3e
commit
423ef5c4b1
@ -279,7 +279,7 @@ func (id *Identity) SaveBackgroundJob() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = os.WriteFile(filepath.Join(GetConfig().StoragePath, ".jobs"), jsonjobs, 0644)
|
err = os.WriteFile(filepath.Join(GetConfig().StoragePath, ".jobs"), jsonjobs, 0600)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ package client
|
|||||||
import (
|
import (
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
"forge.redroom.link/yves/meowlib"
|
"forge.redroom.link/yves/meowlib"
|
||||||
"github.com/dgraph-io/badger"
|
"github.com/dgraph-io/badger"
|
||||||
@ -18,7 +19,7 @@ type ServerStorage struct {
|
|||||||
|
|
||||||
// Open a badger database from struct ServerStorage
|
// Open a badger database from struct ServerStorage
|
||||||
func (ss *ServerStorage) open() error {
|
func (ss *ServerStorage) open() error {
|
||||||
opts := badger.DefaultOptions(ss.DbFile)
|
opts := badger.DefaultOptions(filepath.Join(GetConfig().StoragePath, ss.DbFile))
|
||||||
opts.Logger = nil
|
opts.Logger = nil
|
||||||
var err error
|
var err error
|
||||||
ss.db, err = badger.Open(opts)
|
ss.db, err = badger.Open(opts)
|
||||||
|
Loading…
Reference in New Issue
Block a user