From 87dd12e449a52ddae683dd725f50c5f2b100800d Mon Sep 17 00:00:00 2001 From: wuweifeng10 Date: Thu, 5 Jan 2023 15:50:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E4=B8=8D=E8=B6=B3=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=8D=A1=E6=AD=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/jd/platform/async/wrapper/WorkerWrapper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/jd/platform/async/wrapper/WorkerWrapper.java b/src/main/java/com/jd/platform/async/wrapper/WorkerWrapper.java index fa9973d..57cb735 100755 --- a/src/main/java/com/jd/platform/async/wrapper/WorkerWrapper.java +++ b/src/main/java/com/jd/platform/async/wrapper/WorkerWrapper.java @@ -11,8 +11,8 @@ import com.jd.platform.async.worker.WorkResult; import java.util.*; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; /** @@ -196,8 +196,8 @@ public class WorkerWrapper { .work(executorService, WorkerWrapper.this, remainTime - costTime, forParamUseWrappers), executorService); } try { - CompletableFuture.allOf(futures).get(); - } catch (InterruptedException | ExecutionException e) { + CompletableFuture.allOf(futures).get(remainTime - costTime, TimeUnit.MILLISECONDS); + } catch (Exception e) { e.printStackTrace(); } }