feat(baidu_netdisk): add retry to most operations (close #4863 in #4939)

This commit is contained in:
Sean
2023-08-07 13:44:28 +08:00
committed by GitHub
parent e9cb37122e
commit 7877184bee
17 changed files with 122 additions and 89 deletions

View File

@ -14,8 +14,9 @@ var (
MoveBetweenTwoStorages = errors.New("can't move files between two storages, try to copy")
UploadNotSupported = errors.New("upload not supported")
MetaNotFound = errors.New("meta not found")
StorageNotFound = errors.New("storage not found")
MetaNotFound = errors.New("meta not found")
StorageNotFound = errors.New("storage not found")
StreamIncomplete = errors.New("upload/download stream incomplete, possible network issue")
)
// NewErr wrap constant error with an extra message

View File

@ -27,7 +27,7 @@ func putAsTask(dstDirPath string, file *model.FileStream) error {
return errors.WithStack(errs.UploadNotSupported)
}
if file.NeedStore() {
tempFile, err := utils.CreateTempFile(file)
tempFile, err := utils.CreateTempFile(file, file.GetSize())
if err != nil {
return errors.Wrapf(err, "failed to create temp file")
}