From 5581397aebaf9555ebcd3c0cf5dcfa291d5c3c1a Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 16 Jun 2022 00:56:13 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=BD=9C=E5=9C=A8=E7=9A=84=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=94=81=E9=97=AE=E9=A2=98=20https://github.com/siyua?= =?UTF-8?q?n-note/siyuan/issues/5191?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/sync.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/model/sync.go b/kernel/model/sync.go index a6e9542da..e4bc13913 100644 --- a/kernel/model/sync.go +++ b/kernel/model/sync.go @@ -1078,13 +1078,13 @@ func getWorkspaceDataConf() (conf *filesys.DataConf, err error) { if !gulu.File.IsExist(confPath) { os.MkdirAll(filepath.Dir(confPath), 0755) data, _ := gulu.JSON.MarshalIndentJSON(conf, "", " ") - if err = os.WriteFile(confPath, data, 0644); nil != err { + if err = filelock.NoLockFileWrite(confPath, data); nil != err { util.LogErrorf("save sync conf [%s] failed: %s", confPath, err) } return } - data, err := os.ReadFile(confPath) + data, err := filelock.NoLockFileRead(confPath) if nil != err { util.LogErrorf("read sync conf [%s] failed: %s", confPath, err) return