fix(drivers/guangyapan): report multipart upload progress to copy task - #2989
Open
hugcabbage wants to merge 1 commit into
Open
fix(drivers/guangyapan): report multipart upload progress to copy task#2989hugcabbage wants to merge 1 commit into
hugcabbage wants to merge 1 commit into
Conversation
multipartUploadToOSS passed the UpdateProgress callback into stream.NewStreamSectionReader, which ignores the up argument, so the callback was never invoked while uploading parts. As a result, cross-storage copy tasks targeting GuangYaPan stayed at 0% and showed no progress bar or speed in the task list. Fix by tracking the uploaded byte count and invoking up after every part is uploaded, keeping consistent with other drivers' upload flow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
修复 GuangYaPan 驱动 OSS 分片上传不更新任务进度的问题。
背景:从其他存储(跨存储复制)复制到光鸭云盘时,OpenList 会创建
FileTransferTask并通过GuangYaPan.Put->multipartUploadToOSS上传,但该函数把进度回调
up传入stream.NewStreamSectionReader后从未再调用,而
NewStreamSectionReader的实现会忽略up参数,导致任务进度始终为 0,任务列表不显示进度条和速度。
修复:在
multipartUploadToOSS的分片循环中累计已上传字节数,并在每个分片上传完成后调用
up(100 * uploaded / total)上报进度,与其他驱动保持一致的实现方式。
Behavior changes / 用户可感知的行为变化
进度条与速度(此前停留在 0%)。
copy_file异步任务,不经任务系统)。Implementation changes / 重要实现变化
drivers/guangyapan/util.go:multipartUploadToOSS新增uploaded累计计数,每分片上传成功后调用
up上报百分比进度。/ 此 PR 包含破坏性变更。
/ 此 PR 修改了公开 API、配置、存储格式或迁移行为。
/ 此 PR 需要关联仓库同步修改。
Related repository PRs / 关联仓库 PR:
Related Issues / 关联 Issue
Relates to #2970
Testing / 测试
go build ./drivers/guangyapan/go test ./...Checklist / 检查清单
/ 我已阅读 CONTRIBUTING。
/ 我确认此贡献符合仓库许可证、贡献规范和行为准则。
gofmt,go fmt, orprettierwhere applicable./ 我已按适用情况使用
gofmt、go fmt或prettier格式化变更代码。/ 我已在适用情况下请求相关维护者或代码所有者审查。
AI Disclosure / AI 使用声明
/ 此 PR 包含 AI 辅助内容。
Tools used / 使用工具:
Usage scope / 使用范围:
/ 我已审核并验证此 PR 中的所有 AI 辅助内容。
Co-Authored-Byattribution./ 我已确保所有 AI 辅助提交都包含
Co-Authored-By归属信息。/ 我可以在没有任何 AI 工具的情况下重现此 PR 中包含的所有 AI 辅助内容。