🎨 优化云端同步上传资源占用和耗时 https://github.com/siyuan-note/siyuan/issues/5093

This commit is contained in:
Liang Ding 2022-06-06 15:50:33 +08:00
parent a4b948daca
commit a18d48bdc4
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 37 additions and 82 deletions

View file

@ -278,7 +278,7 @@ func CreateLocalBackup() (err error) {
return
}
_, err = genCloudIndex(newBackupDir, map[string]bool{})
_, err = genCloudIndex(newBackupDir, map[string]bool{}, true)
if nil != err {
return
}
@ -344,7 +344,7 @@ func DownloadBackup() (err error) {
localDirPath := Conf.Backup.GetSaveDir()
util.PushEndlessProgress(Conf.Language(68))
start := time.Now()
fetchedFilesCount, transferSize, _, err := ossDownload(true, localDirPath, "backup", false, map[string]bool{}, map[string]bool{})
fetchedFilesCount, transferSize, _, err := ossDownload(localDirPath, "backup", false, map[string]bool{}, map[string]bool{})
if nil == err {
elapsed := time.Now().Sub(start).Seconds()
util.LogInfof("downloaded backup [fetchedFiles=%d, transferSize=%s] in [%.2fs]", fetchedFilesCount, humanize.Bytes(transferSize), elapsed)