🎨 细化云端同步锁提升稳定性 https://github.com/siyuan-note/siyuan/issues/5887

This commit is contained in:
Liang Ding 2022-09-18 09:14:34 +08:00
parent 963b409e4e
commit 11e4c88f5a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
15 changed files with 110 additions and 106 deletions

View file

@ -1203,7 +1203,7 @@ func RemoveDoc(boxID, p string) (err error) {
historyPath := filepath.Join(historyDir, boxID, p)
absPath := filepath.Join(util.DataDir, boxID, p)
if err = util.Copy(absPath, historyPath); nil != err {
if err = filesys.Copy(absPath, historyPath); nil != err {
return errors.New(fmt.Sprintf(Conf.Language(70), box.Name, absPath, err))
}
@ -1534,8 +1534,8 @@ func ChangeFileTreeSort(boxID string, paths []string) {
}
WaitForWritingFiles()
util.LockWriteFile()
defer util.UnlockWriteFile()
filesys.LockWriteFile()
defer filesys.UnlockWriteFile()
box := Conf.Box(boxID)
sortIDs := map[string]int{}