mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
⚡ 云端数据同步时降低交互阻塞时间 Fix https://github.com/siyuan-note/siyuan/issues/4984
This commit is contained in:
parent
1cdc80e1bd
commit
c88bd514d3
10 changed files with 63 additions and 91 deletions
|
|
@ -43,7 +43,7 @@ var (
|
|||
ErrNotFullyBoot = errors.New("the kernel has not been fully booted, please try again later")
|
||||
)
|
||||
|
||||
var writingTreeLock = sync.Mutex{}
|
||||
var writingDataLock = sync.Mutex{}
|
||||
|
||||
func IsFoldHeading(transactions *[]*Transaction) bool {
|
||||
if 1 == len(*transactions) && 1 == len((*transactions)[0].DoOperations) {
|
||||
|
|
@ -114,8 +114,8 @@ func AutoFlushTx() {
|
|||
}
|
||||
|
||||
func flushTx() {
|
||||
writingTreeLock.Lock()
|
||||
defer writingTreeLock.Unlock()
|
||||
writingDataLock.Lock()
|
||||
defer writingDataLock.Unlock()
|
||||
defer util.Recover()
|
||||
|
||||
currentTx = mergeTx()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue