Fix new Workers not getting added.

This commit is contained in:
2025-09-04 23:02:24 +02:00
parent c8be88d645
commit 2d662c269b
2 changed files with 10 additions and 0 deletions

View File

@@ -145,6 +145,12 @@ public static class Tranga
private static Action AfterWork(BaseWorker worker, Action? callback = null) => () =>
{
Log.Debug($"AfterWork {worker}");
if (RunningWorkers.TryGetValue(worker, out Task<BaseWorker[]>? task))
{
BaseWorker[] newWorkers = task.Result;
Log.Debug($"Resulted in {newWorkers.Length} new Workers.");
AddWorkers(newWorkers);
}
RunningWorkers.Remove(worker, out _);
callback?.Invoke();
};