mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
🎨 支持多设备操作不同文档后云端同步合并 https://github.com/siyuan-note/siyuan/issues/5092
This commit is contained in:
parent
801050ab8d
commit
8db76a66ff
1 changed files with 4 additions and 1 deletions
|
|
@ -188,6 +188,7 @@ func ossDownload(localDirPath, cloudDirPath string, bootOrExit bool) (fetchedFil
|
|||
needPushProgress := 32 < len(cloudFetches)
|
||||
waitGroup := &sync.WaitGroup{}
|
||||
var downloadErr error
|
||||
downloadedFilesLock := sync.Mutex{}
|
||||
downloadedFiles = map[string]bool{}
|
||||
poolSize := 4
|
||||
if poolSize > len(cloudFetches)-1 /* 不计入 /.siyuan/conf.json,配置文件最后单独下载 */ {
|
||||
|
|
@ -205,7 +206,9 @@ func ossDownload(localDirPath, cloudDirPath string, bootOrExit bool) (fetchedFil
|
|||
downloadErr = err // 仅记录最后一次错误
|
||||
return
|
||||
}
|
||||
downloadedFiles[fetch] = true // FIXME: 并发修改 map
|
||||
downloadedFilesLock.Lock()
|
||||
downloadedFiles[fetch] = true
|
||||
downloadedFilesLock.Unlock()
|
||||
|
||||
if needPushProgress {
|
||||
msg := fmt.Sprintf(Conf.Language(103), fetchedFilesCount, len(cloudFetches)-fetchedFilesCount)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue