Fix asynchronous chapter checking

This commit is contained in:
2025-09-05 00:08:48 +02:00
parent ee3789fdfd
commit 35e36a557c

View File

@@ -16,7 +16,7 @@ public class UpdateChaptersDownloadedWorker(TimeSpan? interval = null, IEnumerab
Log.Debug("Checking chapter files..."); Log.Debug("Checking chapter files...");
List<Chapter> chapters = await DbContext.Chapters.ToListAsync(CancellationToken); List<Chapter> chapters = await DbContext.Chapters.ToListAsync(CancellationToken);
Log.Debug($"Checking {chapters.Count} chapters..."); Log.Debug($"Checking {chapters.Count} chapters...");
chapters.ForEach(async void (chapter) => foreach (Chapter chapter in chapters)
{ {
try try
{ {
@@ -26,7 +26,7 @@ public class UpdateChaptersDownloadedWorker(TimeSpan? interval = null, IEnumerab
{ {
Log.Error(exception); Log.Error(exception);
} }
}); }
if(await DbContext.Sync(CancellationToken) is { success: false } e) if(await DbContext.Sync(CancellationToken) is { success: false } e)
Log.Error($"Failed to save database changes: {e.exceptionMessage}"); Log.Error($"Failed to save database changes: {e.exceptionMessage}");