mirror of
https://gitee.com/jd-platform-opensource/asyncTool.git
synced 2025-12-26 05:37:19 +08:00
优化有多个依赖的情况:如果当前任务已经完成了,依赖的其他任务拿到锁再进来时,不需要执行下面的逻辑了。
This commit is contained in:
parent
960d0085cb
commit
c404be0b65
@ -216,6 +216,10 @@ public class WorkerWrapper<T, V> {
|
||||
}
|
||||
|
||||
private synchronized void doDependsJobs(ExecutorService executorService, List<DependWrapper> dependWrappers, WorkerWrapper fromWrapper, long now, long remainTime) {
|
||||
//如果当前任务已经完成了,依赖的其他任务拿到锁再进来时,不需要执行下面的逻辑了。
|
||||
if (!checkIsNullResult()) {
|
||||
return ;
|
||||
}
|
||||
boolean nowDependIsMust = false;
|
||||
//创建必须完成的上游wrapper集合
|
||||
Set<DependWrapper> mustWrapper = new HashSet<>();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user