Add total progress of task execution

This commit is contained in:
huangyuhui
2018-09-07 15:12:41 +08:00
parent 84c18c8693
commit ce9d882c9f
4 changed files with 47 additions and 10 deletions

View File

@@ -159,11 +159,12 @@ public final class TaskExecutor {
if (doDependentsSucceeded)
task.setDependentsSucceeded();
task.setState(Task.TaskState.RUNNING);
taskListeners.forEach(it -> it.onRunning(task));
try {
task.getScheduler().schedule(task::execute).get();
task.getScheduler().schedule(() -> {
task.setState(Task.TaskState.RUNNING);
taskListeners.forEach(it -> it.onRunning(task));
task.execute();
}).get();
} catch (ExecutionException e) {
if (e.getCause() instanceof Exception)
throw (Exception) e.getCause();