From 35e36a557c0b25850df5cfeef51477ee40a1f0c9 Mon Sep 17 00:00:00 2001 From: glax Date: Fri, 5 Sep 2025 00:08:48 +0200 Subject: [PATCH] Fix asynchronous chapter checking --- API/Workers/PeriodicWorkers/UpdateChaptersDownloadedWorker.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/API/Workers/PeriodicWorkers/UpdateChaptersDownloadedWorker.cs b/API/Workers/PeriodicWorkers/UpdateChaptersDownloadedWorker.cs index 97e3fe5..3c9de48 100644 --- a/API/Workers/PeriodicWorkers/UpdateChaptersDownloadedWorker.cs +++ b/API/Workers/PeriodicWorkers/UpdateChaptersDownloadedWorker.cs @@ -16,7 +16,7 @@ public class UpdateChaptersDownloadedWorker(TimeSpan? interval = null, IEnumerab Log.Debug("Checking chapter files..."); List chapters = await DbContext.Chapters.ToListAsync(CancellationToken); Log.Debug($"Checking {chapters.Count} chapters..."); - chapters.ForEach(async void (chapter) => + foreach (Chapter chapter in chapters) { try { @@ -26,7 +26,7 @@ public class UpdateChaptersDownloadedWorker(TimeSpan? interval = null, IEnumerab { Log.Error(exception); } - }); + } if(await DbContext.Sync(CancellationToken) is { success: false } e) Log.Error($"Failed to save database changes: {e.exceptionMessage}");