Conversation
Contributor
|
建议你同步一下上游,现在上游的目录结构有比较大的改变 |
# Conflicts: # PCL.Core/IO/Download/IDlConnection.cs # PCL.Core/IO/Download/IDlResourceMapping.cs # PCL.Core/IO/Download/IDlWriter.cs # PCL.Core/IO/Download/NDlFactory.cs # PCL.Core/Net/NDownload/IDlConnection.cs # PCL.Core/Net/NDownload/IDlResourceMapping.cs # PCL.Core/Net/NDownload/IDlWriter.cs # PCL.Core/Net/NDownload/Interfaces/IDlConnection.cs # PCL.Core/Net/NDownload/Interfaces/IDlResourceMapping.cs # PCL.Core/Net/NDownload/Interfaces/IDlWriter.cs
0584502 to
0ce13e0
Compare
Member
Author
done |
SALTWOOD
reviewed
Feb 21, 2026
| { | ||
| public required string Url { get; init; } | ||
| public bool IsAlive { get; set; } = true; | ||
| public long LatencyMs { get; set; } |
Member
There was a problem hiding this comment.
这里的 LatencyMs 也许可以换个名字?LatencyMilliseconds 个人感觉比较好些
Suggested change
| public long LatencyMs { get; set; } | |
| public long LatencyMilliseconds { get; set; } |
ruattd
requested changes
Feb 21, 2026
Contributor
ruattd
left a comment
There was a problem hiding this comment.
存在几个问题:
- 应该存在一个全局共用的线程数限制
- 应当支持处理多个文件和多次提交,并复用已有的 DownloadClient 实例,一个下载任务很可能包含一大批文件且可能先后多次提交,它们要与已存在的所有任务共享全局线程数限制,在有必要的时候需要排队机制
- HttpClient 应使用传入 getter delegate 的方式获取,每次下载均创建一个 HttpClient 会导致大量小文件下载时初始化时长远大于实际数据传输时长,极其影响性能
- 需要支持持久化 mirror 数据,因为一个 mirror 的质量在一个用户那里大概率是一直相同的,每次都收集数据并动态决策本身就是很耗时的操作了(因此也引出了新的问题:需要考虑更复杂更全面的 mirror 评估算法)
- 测试明显像 AI 写的,代码的 AI 参与度比较存疑,这点需要一个明确解释
Comment on lines
+13
to
+14
|
|
||
| namespace PCL.Core.Net.Downloader; |
Contributor
There was a problem hiding this comment.
命名空间与目录不一致,低级问题,大概看了下所有 Download 目录里的文件都有这个问题
Comment on lines
1
to
13
| @@ -8,9 +11,6 @@ | |||
| using System.Text.Json; | |||
| using System.Threading; | |||
| using System.Threading.Tasks; | |||
| using PCL.Core.App; | |||
| using PCL.Core.Logging; | |||
| using PCL.Core.Utils.Exts; | |||
Member
Author
测试懒得写,直接丢给AI让他写了(
这个PR只是一个底层的部分,我计划把这个作为上层部分来实现(DownloadManager)
我实在想不出来,请大神来co-auther |
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.
普普通通的下载器。
因为过于久远,我忘了要求,如果哪里不好提个review。
使用方法见
PCL.Core.Test.Downloader.RealFileDownloadTests.DownloadFile_ShouldCompleteSuccessfully()