This commit is contained in:
Liang Ding 2022-06-15 23:56:47 +08:00
parent 4170f50dc6
commit 102d9364fd
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
25 changed files with 118 additions and 398 deletions

View file

@ -34,8 +34,8 @@ import (
"github.com/88250/lute"
humanize "github.com/dustin/go-humanize"
"github.com/getsentry/sentry-go"
"github.com/siyuan-note/filelock"
"github.com/siyuan-note/siyuan/kernel/conf"
"github.com/siyuan-note/siyuan/kernel/filesys"
"github.com/siyuan-note/siyuan/kernel/sql"
"github.com/siyuan-note/siyuan/kernel/treenode"
"github.com/siyuan-note/siyuan/kernel/util"
@ -386,7 +386,7 @@ func (conf *AppConf) Save() {
newData, _ := gulu.JSON.MarshalIndentJSON(Conf, "", " ")
confPath := filepath.Join(util.ConfDir, "conf.json")
oldData, err := filesys.NoLockFileRead(confPath)
oldData, err := filelock.NoLockFileRead(confPath)
if nil != err {
conf.save0(newData)
return
@ -401,7 +401,7 @@ func (conf *AppConf) Save() {
func (conf *AppConf) save0(data []byte) {
confPath := filepath.Join(util.ConfDir, "conf.json")
if err := filesys.LockFileWrite(confPath, data); nil != err {
if err := filelock.LockFileWrite(confPath, data); nil != err {
util.LogFatalf("write conf [%s] failed: %s", confPath, err)
}
}