From 6b546bc7a4ed76dac25d33a41a753b8680bd5ee1 Mon Sep 17 00:00:00 2001 From: kyle <573984425@qq.com> Date: Thu, 2 Feb 2023 09:00:36 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=AE=80=E5=8C=96=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/jd/platform/async/executor/Async.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/asyncTool-core/src/main/java/com/jd/platform/async/executor/Async.java b/asyncTool-core/src/main/java/com/jd/platform/async/executor/Async.java index 9299efc..7c66de9 100644 --- a/asyncTool-core/src/main/java/com/jd/platform/async/executor/Async.java +++ b/asyncTool-core/src/main/java/com/jd/platform/async/executor/Async.java @@ -136,10 +136,8 @@ public class Async { //任务结束就退出检查 if (onceWork.isFinish()) { break; - } - //完成或者取消就及时取消任务 - if (!onceWork.isFinish() - && onceWork.getAllThreadSubmit().stream().allMatch(future -> future.isDone() || future.isCancelled())) { + } else if (onceWork.getAllThreadSubmit().stream().allMatch(future -> future.isDone() || future.isCancelled())) { + //完成或者取消就及时取消任务 if (!onceWork.isCancelled() && !onceWork.isWaitingCancel()) { onceWork.pleaseCancel(); }