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 623374c848cbd87e61385d6a3bd281b9b9dbaa0a..b1392b1490dfc35f7b0a3fa29d20a9b00ed7e8a8 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); }