Skip to content

Commit

Permalink
修改了几处问题
Browse files Browse the repository at this point in the history
  • Loading branch information
YangSpring114 committed Dec 21, 2024
1 parent 486e1a0 commit 8ea7640
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace MinecraftLaunch.Classes.Models.Download;

public sealed record DownloaderConfiguration {
public readonly static DownloaderConfiguration Default = new DownloaderConfiguration {
public readonly static DownloaderConfiguration Default = new() {
MaxThread = 128,
IsEnableFragmentedDownload = true,
};
Expand Down
4 changes: 2 additions & 2 deletions MinecraftLaunch/Components/Downloader/FileDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ private class DownloadStates {

public FileDownloader(
DownloaderConfiguration configuration) {
_config = new DownloaderConfig(1048576, 8, configuration.MaxThread);
_globalDownloadTasksSemaphore = new SemaphoreSlim(8, configuration.MaxThread);
_config = new DownloaderConfig(1024 * 1024, configuration.MaxThread, configuration.MaxThread);
_globalDownloadTasksSemaphore = new SemaphoreSlim(configuration.MaxThread, configuration.MaxThread);
}

public static string GetSpeedText(double speed) {
Expand Down
2 changes: 1 addition & 1 deletion MinecraftLaunch/Components/Installer/VanlliaInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ await File.WriteAllTextAsync(versionJsonFile.FullName,
await resourceChecker.MissingResources.DownloadResourceEntrysAsync(_configuration, x => {
ReportProgress(x.ToPercentage().ToPercentage(0.45d, 0.95d),
$"Downloading dependent resources:{x.CompletedCount}/{x.TotalCount}",
TaskStatus.Running);
TaskStatus.Running, x.Speed);
}, cancellation);
}

Expand Down

0 comments on commit 8ea7640

Please sign in to comment.