mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
:file: 移除文件锁 https://github.com/siyuan-note/siyuan/issues/6010
This commit is contained in:
parent
56129699b9
commit
69a9713776
38 changed files with 193 additions and 438 deletions
|
|
@ -362,7 +362,6 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
|
|||
|
||||
logging.LogInfof("exiting kernel [force=%v, execInstallPkg=%d]", force, execInstallPkg)
|
||||
|
||||
treenode.CloseBlockTree()
|
||||
util.PushMsg(Conf.Language(95), 10000*60)
|
||||
WaitForWritingFiles()
|
||||
if !force {
|
||||
|
|
@ -435,7 +434,7 @@ func (conf *AppConf) Save() {
|
|||
|
||||
newData, _ := gulu.JSON.MarshalIndentJSON(Conf, "", " ")
|
||||
confPath := filepath.Join(util.ConfDir, "conf.json")
|
||||
oldData, err := filelock.NoLockFileRead(confPath)
|
||||
oldData, err := filelock.ReadFile(confPath)
|
||||
if nil != err {
|
||||
conf.save0(newData)
|
||||
return
|
||||
|
|
@ -450,7 +449,7 @@ func (conf *AppConf) Save() {
|
|||
|
||||
func (conf *AppConf) save0(data []byte) {
|
||||
confPath := filepath.Join(util.ConfDir, "conf.json")
|
||||
if err := filelock.NoLockFileWrite(confPath, data); nil != err {
|
||||
if err := filelock.WriteFile(confPath, data); nil != err {
|
||||
logging.LogFatalf("write conf [%s] failed: %s", confPath, err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue