mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
🎨 细化云端同步锁提升稳定性 Fix https://github.com/siyuan-note/siyuan/issues/5887
This commit is contained in:
parent
a942ae6a1b
commit
b53cb6c78b
4 changed files with 20 additions and 2 deletions
|
|
@ -918,9 +918,12 @@ func loadNodesByMode(node *ast.Node, inputIndex, mode, size int, isDoc, isHeadin
|
|||
}
|
||||
|
||||
func writeJSONQueue(tree *parse.Tree) (err error) {
|
||||
writingDataLock.Lock()
|
||||
if err = filesys.WriteTree(tree); nil != err {
|
||||
writingDataLock.Unlock()
|
||||
return
|
||||
}
|
||||
writingDataLock.Unlock()
|
||||
sql.UpsertTreeQueue(tree)
|
||||
return
|
||||
}
|
||||
|
|
@ -931,9 +934,12 @@ func indexWriteJSONQueue(tree *parse.Tree) (err error) {
|
|||
}
|
||||
|
||||
func renameWriteJSONQueue(tree *parse.Tree, oldHPath string) (err error) {
|
||||
writingDataLock.Unlock()
|
||||
if err = filesys.WriteTree(tree); nil != err {
|
||||
writingDataLock.Unlock()
|
||||
return
|
||||
}
|
||||
writingDataLock.Unlock()
|
||||
sql.RenameTreeQueue(tree, oldHPath)
|
||||
treenode.ReindexBlockTree(tree)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue