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

This commit is contained in:
Liang Ding 2022-06-06 15:06:25 +08:00
parent e8351aab04
commit 7f5ddc5838
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -802,21 +802,22 @@ func localUpsertRemoveListOSS(localDirPath string, cloudFileList map[string]*Clo
return nil
}
// TODO: 优化云端同步上传资源占用和耗时 https://github.com/siyuan-note/siyuan/issues/5093
if 0 < cloudIdx.Updated {
// 优先使用时间戳校验
if localModTime := info.ModTime().Unix(); cloudIdx.Updated == localModTime {
unchanged[relPath] = true
return nil
}
}
localHash, hashErr := util.GetEtag(path)
if nil != hashErr {
err = hashErr
return io.EOF
}
if cloudIdx.Hash == localHash {
unchanged[relPath] = true
}
//localModTime := info.ModTime().Unix()
//if cloudIdx.Updated == localModTime {
// unchanged[relPath] = true
//}
return nil
})