🎨 文件夹不编入路径映射

This commit is contained in:
Liang Ding 2022-06-06 00:20:04 +08:00
parent 603da6e948
commit 9ba54bf495
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 5 additions and 17 deletions

View file

@ -291,6 +291,10 @@ func ossDownload(isBackup bool, localDirPath, cloudDirPath string, bootOrExit bo
// 同步下载可能会报错,为了确保本地数据版本号不变所以不能更新配置文件,配置文件最后单独下载
continue
}
if "/"+pathJSON == fetch {
// 已经在前面验证解密的步骤中下载过了,目前位于 temp/sync/pathJSON
continue
}
waitGroup.Add(1)
p.Invoke(fetch)

View file

@ -329,22 +329,6 @@ func SyncData(boot, exit, byHand bool) {
return
}
// 解密验证成功后将其移动到 sync/ 文件夹下
if err = os.Rename(tmpPathJSON, filepath.Join(localSyncDirPath, pathJSON)); nil != err {
util.PushClearProgress()
msg := fmt.Sprintf(Conf.Language(80), formatErrorMsg(err))
Conf.Sync.Stat = msg
util.PushErrMsg(msg, 7000)
if boot {
BootSyncSucc = 1
}
if exit {
ExitSyncSucc = 1
}
syncDownloadErrCount++
return
}
fetchedFilesCount, transferSize, downloadedFiles, err := ossDownload(false, localSyncDirPath, "sync/"+Conf.Sync.CloudName, boot || exit, removeList, upsertList)
if nil != err {
util.PushClearProgress()
@ -569,7 +553,7 @@ func syncDir2WorkspaceData(boot bool) (upsertFiles, removeFiles []string, err er
}
modified := modifiedSyncList(unchanged)
metaPath := filepath.Join(Conf.Sync.GetSaveDir(), pathJSON)
metaPath := filepath.Join(util.TempDir, "sync", pathJSON) // 使用前面解密验证时下载的临时文件
indexPath := filepath.Join(Conf.Sync.GetSaveDir(), "index.json")
decryptedDataDir, upsertFiles, err := recoverSyncData(metaPath, indexPath, modified)
if nil != err {