提交 698b1e41 编写于 作者: lakernote's avatar lakernote

增强异步线程池情况下trace功能

上级 39576ffa
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册