From 698b1e4131f5cc4cb8740ea886a5324349b720ba Mon Sep 17 00:00:00 2001 From: laker <935009066@qq.com> Date: Mon, 17 Apr 2023 11:05:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E5=BC=82=E6=AD=A5=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E6=B1=A0=E6=83=85=E5=86=B5=E4=B8=8Btrace=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thread/EasyAdminThreadPoolExecutor.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/laker/admin/framework/ext/thread/EasyAdminThreadPoolExecutor.java b/src/main/java/com/laker/admin/framework/ext/thread/EasyAdminThreadPoolExecutor.java index 623374c..b1392b1 100644 --- a/src/main/java/com/laker/admin/framework/ext/thread/EasyAdminThreadPoolExecutor.java +++ b/src/main/java/com/laker/admin/framework/ext/thread/EasyAdminThreadPoolExecutor.java @@ -94,20 +94,20 @@ public class EasyAdminThreadPoolExecutor extends ThreadPoolExecutor { @Override protected void afterExecute(Runnable r, Throwable t) { super.afterExecute(r, t); -// if (t == null && r instanceof Future) { -// try { -//// Object result = ((Future) r).get(); -// ((Future) r).get(); -// } catch (CancellationException ce) { -// t = ce; -// } catch (ExecutionException ee) { -// t = ee.getCause(); -// } catch (InterruptedException ie) { -// Thread.currentThread().interrupt(); // ignore/reset -// } -// } + if (t == null && r instanceof Future) { + try { +// Object result = ((Future) r).get(); + ((Future) r).get(); + } catch (CancellationException ce) { + t = ce; + } catch (ExecutionException ee) { + t = ee.getCause(); + } catch (InterruptedException ie) { + Thread.currentThread().interrupt(); // ignore/reset + } + } if (t != null) { - log.error("", t); + log.error("线程池中的任务执行异常!!!", t); } log.debug("afterExecute-任务:{},异常:{}", r, t); } -- GitLab