Export Data when starting new task

This commit is contained in:
glax 2023-05-20 23:12:15 +02:00
parent e564be08f5
commit a557f8cab5

View File

@ -66,8 +66,12 @@ public class TaskManager
foreach (KeyValuePair<Connector, List<TrangaTask>> connectorTaskQueue in tasksToExecute) foreach (KeyValuePair<Connector, List<TrangaTask>> connectorTaskQueue in tasksToExecute)
{ {
connectorTaskQueue.Value.RemoveAll(task => task.state == TrangaTask.ExecutionState.Waiting); connectorTaskQueue.Value.RemoveAll(task => task.state == TrangaTask.ExecutionState.Waiting);
if (connectorTaskQueue.Value.Count > 0 && connectorTaskQueue.Value.All(task => task.state is TrangaTask.ExecutionState.Running or TrangaTask.ExecutionState.Enqueued)) if (connectorTaskQueue.Value.Count > 0 && connectorTaskQueue.Value.All(task =>
task.state is TrangaTask.ExecutionState.Running or TrangaTask.ExecutionState.Enqueued))
{
ExecuteTaskNow(connectorTaskQueue.Value.First()); ExecuteTaskNow(connectorTaskQueue.Value.First());
ExportData(Directory.GetCurrentDirectory());
}
} }
//Check if task should be executed //Check if task should be executed