mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-24 01:06:09 +01:00
🎨 文件夹不编入路径映射
This commit is contained in:
parent
9ba54bf495
commit
42ff4a8fe4
2 changed files with 9 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1006,7 +1006,7 @@ func calcUnchangedDataList(passwd string) (unchangedDataList map[string]bool, re
|
|||
unchangedDataList = map[string]bool{}
|
||||
removeList = map[string]bool{}
|
||||
filepath.Walk(syncDir, func(path string, info fs.FileInfo, _ error) error {
|
||||
if syncDir == path || pathJSON == info.Name() {
|
||||
if syncDir == path || pathJSON == info.Name() || "index.json" == info.Name() || info.IsDir() {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue