Skip to content

Commit

Permalink
Adjust reserved thread count as a const
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-nyan committed Aug 30, 2024
1 parent 94f9b3e commit 7cfcee1
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected virtual async Task<List<LocalFileInfo>> GetUnusedFileInfoList(bool inc
{
// Initialize new proxy-aware HttpClient
using HttpClient httpClient = new HttpClientBuilder()
.UseLauncherConfig(_downloadThreadCount + 16)
.UseLauncherConfig(_downloadThreadCount + _downloadThreadCountReserved)
.SetAllowedDecompression(DecompressionMethods.None)
.Create();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ protected virtual async ValueTask StartDeltaPatchPreReqDownload(List<GameInstall

// Initialize new proxy-aware HttpClient
using HttpClient httpClientNew = new HttpClientBuilder()
.UseLauncherConfig(_downloadThreadCount + 16)
.UseLauncherConfig(_downloadThreadCount + _downloadThreadCountReserved)
.SetAllowedDecompression(DecompressionMethods.None)
.Create();

Expand Down Expand Up @@ -669,7 +669,7 @@ public virtual async Task StartPackageDownload(bool skipDialog)

// Initialize new proxy-aware HttpClient
using HttpClient httpClientNew = new HttpClientBuilder()
.UseLauncherConfig(_downloadThreadCount + 16)
.UseLauncherConfig(_downloadThreadCount + _downloadThreadCountReserved)
.SetAllowedDecompression(DecompressionMethods.None)
.Create();

Expand Down
2 changes: 1 addition & 1 deletion CollapseLauncher/Classes/RepairManagement/Genshin/Fetch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private async ValueTask<List<PkgVersionProperties>> Fetch(List<PkgVersionPropert

// Initialize new proxy-aware HttpClient
using HttpClient client = new HttpClientBuilder()
.UseLauncherConfig(_downloadThreadCount + 16)
.UseLauncherConfig(_downloadThreadCount + _downloadThreadCountReserved)
.SetUserAgent(_userAgent)
.SetAllowedDecompression(DecompressionMethods.None)
.Create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private async Task<bool> Repair(List<PkgVersionProperties> repairAssetIndex, Can

// Initialize new proxy-aware HttpClient
using HttpClient client = new HttpClientBuilder<SocketsHttpHandler>()
.UseLauncherConfig(_downloadThreadCount + 16)
.UseLauncherConfig(_downloadThreadCount + _downloadThreadCountReserved)
.SetUserAgent(_userAgent)
.SetAllowedDecompression(DecompressionMethods.None)
.Create();
Expand Down
2 changes: 1 addition & 1 deletion CollapseLauncher/Classes/RepairManagement/Honkai/Fetch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private async Task Fetch(List<FilePropertiesRemote> assetIndex, CancellationToke

// Initialize new proxy-aware HttpClient
using HttpClient client = new HttpClientBuilder()
.UseLauncherConfig(_downloadThreadCount + 16)
.UseLauncherConfig(_downloadThreadCount + _downloadThreadCountReserved)
.SetUserAgent(_userAgent)
.SetAllowedDecompression(DecompressionMethods.None)
.Create();
Expand Down
4 changes: 2 additions & 2 deletions CollapseLauncher/Classes/RepairManagement/Honkai/Repair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private async Task<bool> Repair(List<FilePropertiesRemote> repairAssetIndex, Can

// Initialize new proxy-aware HttpClient
using HttpClient client = new HttpClientBuilder<SocketsHttpHandler>()
.UseLauncherConfig(_downloadThreadCount + 16)
.UseLauncherConfig(_downloadThreadCount + _downloadThreadCountReserved)
.SetUserAgent(_userAgent)
.SetAllowedDecompression(DecompressionMethods.None)
.Create();
Expand Down Expand Up @@ -156,7 +156,7 @@ private async Task RepairAssetTypeGeneric((FilePropertiesRemote AssetIndex, IAss
true);

// Set URL of the asset
string assetURL = customURL != null ? customURL : asset.AssetIndex.RN;
string assetURL = customURL ?? asset.AssetIndex.RN;
string assetPath = Path.Combine(_gamePath, ConverterTool.NormalizePath(asset.AssetIndex.N));

if (asset.AssetIndex.FT == FileType.Unused && !_isOnlyRecoverMain)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private async Task Fetch(List<FilePropertiesRemote> assetIndex, CancellationToke

// Initialize new proxy-aware HttpClient
using HttpClient client = new HttpClientBuilder()
.UseLauncherConfig(_downloadThreadCount + 16)
.UseLauncherConfig(_downloadThreadCount + _downloadThreadCountReserved)
.SetUserAgent(_userAgent)
.SetAllowedDecompression(DecompressionMethods.None)
.Create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private async Task<bool> Repair(List<FilePropertiesRemote> repairAssetIndex, Can

// Initialize new proxy-aware HttpClient
using HttpClient client = new HttpClientBuilder<SocketsHttpHandler>()
.UseLauncherConfig(_downloadThreadCount + 16)
.UseLauncherConfig(_downloadThreadCount + _downloadThreadCountReserved)
.SetUserAgent(_userAgent)
.SetAllowedDecompression(DecompressionMethods.None)
.Create();
Expand Down

0 comments on commit 7cfcee1

Please sign in to comment.