Added CancellationToken to TrangaTask #14

This commit is contained in:
2023-06-10 14:27:09 +02:00
parent 32f89f9dce
commit 1c94625840
9 changed files with 63 additions and 28 deletions

View File

@ -8,8 +8,10 @@ public class UpdateLibrariesTask : TrangaTask
{
}
protected override void ExecuteTask(TaskManager taskManager, Logger? logger)
protected override void ExecuteTask(TaskManager taskManager, Logger? logger, CancellationToken? cancellationToken = null)
{
if (cancellationToken?.IsCancellationRequested??false)
return;
foreach(LibraryManager lm in taskManager.settings.libraryManagers)
lm.UpdateLibrary();
this.progress = 1f;