mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
⚡ 优化云端同步上传资源占用 https://github.com/siyuan-note/siyuan/issues/5093
This commit is contained in:
parent
91e5ddd049
commit
a1d2ab5ff9
2 changed files with 29 additions and 13 deletions
|
|
@ -665,8 +665,8 @@ func genFullCloudIndex(localDirPath string, excludes map[string]bool) (err error
|
|||
return
|
||||
}
|
||||
|
||||
// genCloudIndex 增量生成云端索引文件。
|
||||
func genIncCloudIndex(localDirPath string, localFileList *map[string]*CloudIndex, removes, upserts, excludes map[string]bool) (err error) {
|
||||
// incCloudIndex 增量生成云端索引文件。
|
||||
func incCloudIndex(localDirPath string, localFileList *map[string]*CloudIndex, removes, upserts, excludes map[string]bool) (err error) {
|
||||
for remove, _ := range removes {
|
||||
delete(*localFileList, remove)
|
||||
}
|
||||
|
|
@ -692,16 +692,6 @@ func genIncCloudIndex(localDirPath string, localFileList *map[string]*CloudIndex
|
|||
}
|
||||
(*localFileList)[upsert] = &CloudIndex{Hash: hash, Size: info.Size()}
|
||||
}
|
||||
|
||||
data, err := gulu.JSON.MarshalJSON(localFileList)
|
||||
if nil != err {
|
||||
util.LogErrorf("marshal sync cloud index failed: %s", err)
|
||||
return
|
||||
}
|
||||
if err = os.WriteFile(filepath.Join(localDirPath, "index.json"), data, 0644); nil != err {
|
||||
util.LogErrorf("write sync cloud index failed: %s", err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue