mirror of
https://github.com/C9Glax/tranga.git
synced 2025-09-10 11:58:19 +02:00
Fix task finished before Finish-Action could be set.
This commit is contained in:
@@ -89,9 +89,10 @@ public abstract class BaseWorker : Identifiable
|
|||||||
// Run the actual work
|
// Run the actual work
|
||||||
Log.Info($"Running {this}");
|
Log.Info($"Running {this}");
|
||||||
DateTime startTime = DateTime.UtcNow;
|
DateTime startTime = DateTime.UtcNow;
|
||||||
Task<BaseWorker[]> task = DoWorkInternal();
|
Task<BaseWorker[]> task = new Task<BaseWorker[]>(() => DoWorkInternal().Result);
|
||||||
task.GetAwaiter().OnCompleted(Finish(startTime, callback));
|
task.GetAwaiter().OnCompleted(Finish(startTime, callback));
|
||||||
this.State = WorkerExecutionState.Running;
|
this.State = WorkerExecutionState.Running;
|
||||||
|
task.Start();
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user