From 086ecad3e32df64af3c7e7e277026eb1c5a4d754 Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Tue, 13 Aug 2024 17:10:12 +0800 Subject: [PATCH] =?UTF-8?q?bug=20#IAJR32=20=E4=BF=AE=E5=A4=8D=E5=9C=A8Para?= =?UTF-8?q?llelStrategyExecutor=E5=8F=AF=E8=83=BD=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E7=9A=84NPE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flow/parallel/CompletableFutureExpand.java | 10 +++++++++- .../parallel/strategy/ParallelStrategyExecutor.java | 2 +- pom.xml | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/CompletableFutureExpand.java b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/CompletableFutureExpand.java index 37ba6dbb6..f4a29f5c7 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/CompletableFutureExpand.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/CompletableFutureExpand.java @@ -17,7 +17,15 @@ public class CompletableFutureExpand { return future; } - return future.whenComplete(new Canceller(Delayer.delay(new Timeout<>(future, timeoutDefaultObj), timeout, unit))); + return future.whenComplete( + new Canceller( + Delayer.delay( + new Timeout<>(future, timeoutDefaultObj), + timeout, + unit + ) + ) + ); } /** diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/strategy/ParallelStrategyExecutor.java b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/strategy/ParallelStrategyExecutor.java index 8c9333bd1..398b71749 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/strategy/ParallelStrategyExecutor.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/flow/parallel/strategy/ParallelStrategyExecutor.java @@ -215,7 +215,7 @@ public abstract class ParallelStrategyExecutor { return whenFutureObj; } catch (InterruptedException | ExecutionException e) { interrupted[0] = true; - return null; + return WhenFutureObj.fail("Unknown", e); } }).collect(Collectors.toList()); diff --git a/pom.xml b/pom.xml index ae1d9c243..7aae9ff38 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ - 2.12.2.2 + 2.12.2.3 UTF-8 UTF-8 8