mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 04:02:09 +08:00
bug PercentageOfParallelExecutor 中任务收集列表指定初始值,避免不必要的扩容;复原其他测试案例
This commit is contained in:
@@ -29,7 +29,7 @@ public class PercentageOfParallelExecutor extends ParallelStrategyExecutor {
|
||||
int thresholdCount = (int) Math.ceil(total * whenCondition.getPercentage());
|
||||
|
||||
// 已完成任务收集器(对 List 加锁保证线程安全)
|
||||
List<CompletableFuture<WhenFutureObj>> completedFutures = Collections.synchronizedList(new ArrayList<>(thresholdCount));
|
||||
List<CompletableFuture<WhenFutureObj>> completedFutures = Collections.synchronizedList(new ArrayList<>(Math.max(thresholdCount, 1) << 1));
|
||||
|
||||
// 阈值触发门闩
|
||||
CompletableFuture<Void> thresholdFuture = new CompletableFuture<>();
|
||||
|
||||
Reference in New Issue
Block a user