mirror of
https://github.com/C9Glax/tranga.git
synced 2025-09-10 11:58:19 +02:00
Do not use a Thread to Periodically check for Due workers.
Each Periodic Worker has it's own Thread that waits for execution.
This commit is contained in:
@@ -68,7 +68,7 @@ public abstract class BaseWorker : Identifiable
|
||||
/// <item>If <see cref="BaseWorker"/> has run, additional <see cref="BaseWorker"/>.</item>
|
||||
/// </list>
|
||||
/// </returns>
|
||||
public Task<BaseWorker[]> DoWork()
|
||||
public Task<BaseWorker[]> DoWork(Action? callback = null)
|
||||
{
|
||||
Log.Debug($"Checking {this}");
|
||||
this.State = WorkerExecutionState.Waiting;
|
||||
@@ -93,6 +93,7 @@ public abstract class BaseWorker : Identifiable
|
||||
});
|
||||
task.Start();
|
||||
this.State = WorkerExecutionState.Running;
|
||||
callback?.Invoke();
|
||||
return task;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user