优化有多个依赖的情况:如果当前任务已经完成了,依赖的其他任务拿到锁再进来时,不需要执行下面的逻辑了。

This commit is contained in:
rongtao7 2022-06-12 20:56:31 +08:00
parent c404be0b65
commit 508724c159

View File

@ -217,7 +217,7 @@ public class WorkerWrapper<T, V> {
private synchronized void doDependsJobs(ExecutorService executorService, List<DependWrapper> dependWrappers, WorkerWrapper fromWrapper, long now, long remainTime) { private synchronized void doDependsJobs(ExecutorService executorService, List<DependWrapper> dependWrappers, WorkerWrapper fromWrapper, long now, long remainTime) {
//如果当前任务已经完成了依赖的其他任务拿到锁再进来时不需要执行下面的逻辑了 //如果当前任务已经完成了依赖的其他任务拿到锁再进来时不需要执行下面的逻辑了
if (!checkIsNullResult()) { if (getState() != INIT) {
return ; return ;
} }
boolean nowDependIsMust = false; boolean nowDependIsMust = false;