diff --git a/Wabbajack.App.Wpf/Models/LogStream.cs b/Wabbajack.App.Wpf/Models/LogStream.cs index 0a3d7e1e2..5a997c017 100644 --- a/Wabbajack.App.Wpf/Models/LogStream.cs +++ b/Wabbajack.App.Wpf/Models/LogStream.cs @@ -59,8 +59,6 @@ protected override void Dispose(bool disposing) protected override void Write(LogEventInfo logEvent) { - if(logEvent.Level < LogLevel.Error) - return; _messages.OnNext(new LogMessage(logEvent)); } public interface ILogMessage diff --git a/Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj b/Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj index 6043cb1de..5c0aa72be 100644 --- a/Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj +++ b/Wabbajack.App.Wpf/Wabbajack.App.Wpf.csproj @@ -1,7 +1,7 @@ - Exe + WinExe net9.0-windows true x64 diff --git a/Wabbajack.Installer/AInstaller.cs b/Wabbajack.Installer/AInstaller.cs index e3936e45a..6f4c79e04 100644 --- a/Wabbajack.Installer/AInstaller.cs +++ b/Wabbajack.Installer/AInstaller.cs @@ -371,27 +371,16 @@ public async Task DownloadMissingArchives(List missing, CancellationTok } } - var missingBatches = missing.Batch(100).ToList(); - - List downloadBatches = []; - - foreach (var batch in missingBatches) - { - downloadBatches.Add(batch - .Shuffle() - .Where(a => a.State is not Manual) - .PDoAll(async archive => - { - _logger.LogInformation("Downloading {Archive}", archive.Name); - var outputPath = _configuration.Downloads.Combine(archive.Name); - var hash = await DownloadArchive(archive, download, token, outputPath); - UpdateProgress(1); - })); - - await Task.Delay(TimeSpan.FromSeconds(10)); //If we spin these up too fast we can hit nexus ddos protection regardless of remaining api limit so we slow it down a bit - } - - await Task.WhenAll(downloadBatches); + await missing + .Shuffle() + .Where(a => a.State is not Manual) + .PDoAll(async archive => + { + _logger.LogInformation("Downloading {Archive}", archive.Name); + var outputPath = _configuration.Downloads.Combine(archive.Name); + var hash = await DownloadArchive(archive, download, token, outputPath); + UpdateProgress(1); + }); } private async Task SendDownloadMetrics(List missing) diff --git a/Wabbajack.Networking.Http/ResumableDownloader.cs b/Wabbajack.Networking.Http/ResumableDownloader.cs index 039ecbfc0..10bca2ade 100644 --- a/Wabbajack.Networking.Http/ResumableDownloader.cs +++ b/Wabbajack.Networking.Http/ResumableDownloader.cs @@ -54,6 +54,8 @@ private async Task DownloadAndHash(HttpRequestMessage msg, AbsolutePath fi if (retry == 0) { + _logger.LogError(ex, "Failed to download '{name}'", filePath.FileName.ToString()); + throw; } @@ -65,6 +67,8 @@ private async Task DownloadAndHash(HttpRequestMessage msg, AbsolutePath fi if (retry == 0) { + _logger.LogError(ex, "Failed to download '{name}'", filePath.FileName.ToString()); + throw; } @@ -102,8 +106,8 @@ private async Task DownloadStreamDirectlyToFile(HttpRequestMessage var responseStream = await response.Content.ReadAsStreamAsync(token); - long reportProgressThreshold = 100 * 1024 * 1024; // Report progress every 100MB - bool shoudlReportProgress = job.Size > reportProgressThreshold; // Reporting progress on small files just generates strain on the UI + long reportProgressThreshold = 10 * 1024 * 1024; // Report progress every 100MB + bool shouldReportProgress = job.Size > reportProgressThreshold; // Reporting progress on small files just generates strain on the UI int reportEveryXBytesProcessed = (int) job.Size / 100; // Report progress every 1% of the file long bytesProcessed = startingPosition; @@ -115,7 +119,7 @@ private async Task DownloadStreamDirectlyToFile(HttpRequestMessage await fileStream.WriteAsync(buffer.AsMemory(0, bytesRead), token); bytesProcessed += bytesRead; - if (shoudlReportProgress && bytesProcessed >= reportEveryXBytesProcessed) + if (shouldReportProgress && bytesProcessed >= reportEveryXBytesProcessed) { job.ReportNoWait((int)bytesProcessed); bytesProcessed = 0;