mirror of
https://github.com/C9Glax/tranga.git
synced 2025-07-03 17:34:17 +02:00
Refactor Controllers
SettingsController.cs SearchController.cs QueryController.cs NotificationConnectorController.cs MetadataFetcherController.cs MangaConnectorController.cs FileLibraryController LibraryConnectors WorkerController
This commit is contained in:
@ -13,7 +13,12 @@ public abstract class BaseWorker : Identifiable
|
||||
internal WorkerExecutionState State { get; set; }
|
||||
private static readonly CancellationTokenSource CancellationTokenSource = new(TimeSpan.FromMinutes(10));
|
||||
protected ILog Log { get; init; }
|
||||
public void Cancel() => CancellationTokenSource.Cancel();
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
this.State = WorkerExecutionState.Cancelled;
|
||||
CancellationTokenSource.Cancel();
|
||||
}
|
||||
protected void Fail() => this.State = WorkerExecutionState.Failed;
|
||||
|
||||
public BaseWorker(IEnumerable<BaseWorker>? dependsOn = null)
|
||||
@ -58,5 +63,6 @@ public enum WorkerExecutionState
|
||||
Created = 64,
|
||||
Waiting = 96,
|
||||
Running = 128,
|
||||
Completed = 192
|
||||
Completed = 192,
|
||||
Cancelled = 193
|
||||
}
|
Reference in New Issue
Block a user