diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java index a414891d63..63ebc69536 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java @@ -800,10 +800,7 @@ public class ExecutorServiceImpl extends BaseServiceImpl implements ExecutorServ createCount = listDate.size(); if (!CollectionUtils.isEmpty(listDate)) { if (expectedParallelismNumber != null && expectedParallelismNumber != 0) { - createCount = Math.min(listDate.size(), expectedParallelismNumber); - if (listDateSize < createCount) { - createCount = listDateSize; - } + createCount = Math.min(createCount, expectedParallelismNumber); } logger.info("In parallel mode, current expectedParallelismNumber:{}", createCount); @@ -843,14 +840,10 @@ public class ExecutorServiceImpl extends BaseServiceImpl implements ExecutorServ } if (StringUtils.isNotEmpty(dateList)) { List listDate = Arrays.asList(dateList.split(COMMA)); - int listDateSize = listDate.size(); createCount = listDate.size(); if (!CollectionUtils.isEmpty(listDate)) { if (expectedParallelismNumber != null && expectedParallelismNumber != 0) { - createCount = Math.min(listDate.size(), expectedParallelismNumber); - if (listDateSize < createCount) { - createCount = listDateSize; - } + createCount = Math.min(createCount, expectedParallelismNumber); } logger.info("In parallel mode, current expectedParallelismNumber:{}", createCount); for (List stringDate : Lists.partition(listDate, createCount)) {