Browse Source

:bug: 云端同步在系统休眠后唤醒会重复执行 Fix https://github.com/siyuan-note/siyuan/issues/5784

Liang Ding 2 years ago
parent
commit
3ad5bb7607
1 changed files with 3 additions and 0 deletions
  1. 3 0
      kernel/model/sync.go

+ 3 - 0
kernel/model/sync.go

@@ -69,6 +69,9 @@ func SyncData(boot, exit, byHand bool) {
 		return
 		return
 	}
 	}
 
 
+	syncLock.Lock()
+	defer syncLock.Unlock()
+
 	if boot {
 	if boot {
 		util.IncBootProgress(3, "Syncing data from the cloud...")
 		util.IncBootProgress(3, "Syncing data from the cloud...")
 		BootSyncSucc = 0
 		BootSyncSucc = 0