TaskCheckerThread new logic
This commit is contained in:
parent
9d0fc18051
commit
554f6b4acc
@ -66,13 +66,11 @@ public class TaskManager
|
|||||||
//Check if previous tasks have finished and execute new tasks
|
//Check if previous tasks have finished and execute new tasks
|
||||||
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);
|
if(connectorTaskQueue.Value.RemoveAll(task => task.state == TrangaTask.ExecutionState.Waiting) > 0)
|
||||||
if (connectorTaskQueue.Value.Count > 0 && connectorTaskQueue.Value.All(task =>
|
|
||||||
task.state is TrangaTask.ExecutionState.Running or TrangaTask.ExecutionState.Enqueued))
|
|
||||||
{
|
|
||||||
ExecuteTaskNow(connectorTaskQueue.Value.First());
|
|
||||||
ExportData(Directory.GetCurrentDirectory());
|
ExportData(Directory.GetCurrentDirectory());
|
||||||
}
|
|
||||||
|
if (connectorTaskQueue.Value.Count > 0 && connectorTaskQueue.Value.All(task => task.state is TrangaTask.ExecutionState.Enqueued))
|
||||||
|
ExecuteTaskNow(connectorTaskQueue.Value.First());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if task should be executed
|
//Check if task should be executed
|
||||||
|
Loading…
Reference in New Issue
Block a user