🎨 文件夹不编入路径映射

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

View file

@ -511,11 +511,11 @@ func ossUpload(isBackup bool, localDirPath, cloudDirPath, cloudDevice string, bo
}
})
index := filepath.Join(localDirPath, "index.json")
meta := filepath.Join(localDirPath, pathJSON)
for _, localUpsert := range localUpserts {
if index == localUpsert {
if index == localUpsert || meta == localUpsert {
// 同步过程中断导致的一致性问题 https://github.com/siyuan-note/siyuan/issues/4912
// index 最后单独上传
index = localUpsert
// index 和路径映射文件最后单独上传
continue
}
@ -529,11 +529,15 @@ func ossUpload(isBackup bool, localDirPath, cloudDirPath, cloudDevice string, bo
return
}
// 单独上传 index
// 单独上传 index 和路径映射
if uploadErr = ossUpload0(localDirPath, cloudDirPath, index, &wroteFiles, &transferSize); nil != uploadErr {
err = uploadErr
return
}
if uploadErr = ossUpload0(localDirPath, cloudDirPath, meta, &wroteFiles, &transferSize); nil != uploadErr {
err = uploadErr
return
}
if needPushProgress {
util.PushMsg(Conf.Language(105), 3000)