mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 同步下载支持断点续传 Fix https://github.com/siyuan-note/siyuan/issues/5056
This commit is contained in:
parent
9b35a01d53
commit
fa45fafca4
1 changed files with 17 additions and 1 deletions
|
|
@ -300,7 +300,9 @@ func SyncData(boot, exit, byHand bool) {
|
||||||
syncDownloadErrCount++
|
syncDownloadErrCount++
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
data, err := os.ReadFile(filepath.Join(util.TempDir, "/sync/"+pathJSON))
|
|
||||||
|
tmpPathJSON := filepath.Join(util.TempDir, "/sync/"+pathJSON)
|
||||||
|
data, err := os.ReadFile(tmpPathJSON)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -320,6 +322,20 @@ func SyncData(boot, exit, byHand bool) {
|
||||||
syncDownloadErrCount++
|
syncDownloadErrCount++
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if err = os.Rename(tmpPathJSON, filepath.Join(localSyncDirPath, pathJSON)); nil != err {
|
||||||
|
util.PushClearMsg()
|
||||||
|
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(localSyncDirPath, "sync/"+Conf.Sync.CloudName, boot || exit)
|
fetchedFilesCount, transferSize, downloadedFiles, err := ossDownload(localSyncDirPath, "sync/"+Conf.Sync.CloudName, boot || exit)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue