mirror of
https://github.com/C9Glax/tranga.git
synced 2025-09-10 11:58:19 +02:00
Allow requests to be cancelled.
Make workers have a CancellationTokenSource
This commit is contained in:
@@ -9,11 +9,11 @@ public class UpdateCoversWorker(TimeSpan? interval = null, IEnumerable<BaseWorke
|
||||
public DateTime LastExecution { get; set; } = DateTime.UnixEpoch;
|
||||
public TimeSpan Interval { get; set; } = interval ?? TimeSpan.FromHours(6);
|
||||
|
||||
protected override BaseWorker[] DoWorkInternal()
|
||||
protected override Task<BaseWorker[]> DoWorkInternal()
|
||||
{
|
||||
List<BaseWorker> workers = new();
|
||||
foreach (MangaConnectorId<Manga> mangaConnectorId in DbContext.MangaConnectorToManga)
|
||||
workers.Add(new DownloadCoverFromMangaconnectorWorker(mangaConnectorId));
|
||||
return workers.ToArray();
|
||||
return new Task<BaseWorker[]>(() => workers.ToArray());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user