From a53e77b4c066270832c09ab8bb40728d9286356f Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Wed, 9 Jan 2019 15:05:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=95=E5=B1=82Log=E8=B0=83=E4=BC=98?= =?UTF-8?q?=EF=BC=8C=E5=BA=94=E7=94=A8=E6=AD=A3=E5=B8=B8=E7=BB=88=E6=AD=A2?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=BC=82=E5=B8=B8=E6=A0=88=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=89=93=E5=8D=B0=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xxl/job/core/thread/ExecutorRegistryThread.java | 9 +++++++-- .../com/xxl/job/core/thread/JobLogFileCleanThread.java | 9 +++++++-- .../com/xxl/job/core/thread/TriggerCallbackThread.java | 8 ++++++-- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/thread/ExecutorRegistryThread.java b/xxl-job-core/src/main/java/com/xxl/job/core/thread/ExecutorRegistryThread.java index e3e13230..57bdb15a 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/thread/ExecutorRegistryThread.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/thread/ExecutorRegistryThread.java @@ -59,13 +59,18 @@ public class ExecutorRegistryThread extends Thread { } } catch (Exception e) { - logger.error(e.getMessage(), e); + if (!toStop) { + logger.error(e.getMessage(), e); + } + } try { TimeUnit.SECONDS.sleep(RegistryConfig.BEAT_TIMEOUT); } catch (InterruptedException e) { - logger.warn(">>>>>>>>>>> xxl-job, executor registry thread interrupted, error msg:{}", e.getMessage()); + if (!toStop) { + logger.warn(">>>>>>>>>>> xxl-job, executor registry thread interrupted, error msg:{}", e.getMessage()); + } } } diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/thread/JobLogFileCleanThread.java b/xxl-job-core/src/main/java/com/xxl/job/core/thread/JobLogFileCleanThread.java index bae732b2..dbe56e5b 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/thread/JobLogFileCleanThread.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/thread/JobLogFileCleanThread.java @@ -82,13 +82,18 @@ public class JobLogFileCleanThread extends Thread { } } catch (Exception e) { - logger.error(e.getMessage(), e); + if (!toStop) { + logger.error(e.getMessage(), e); + } + } try { TimeUnit.DAYS.sleep(1); } catch (InterruptedException e) { - logger.error(e.getMessage(), e); + if (!toStop) { + logger.error(e.getMessage(), e); + } } } logger.info(">>>>>>>>>>> xxl-job, executor JobLogFileCleanThread thread destory."); diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/thread/TriggerCallbackThread.java b/xxl-job-core/src/main/java/com/xxl/job/core/thread/TriggerCallbackThread.java index 28692169..3ff6f9b7 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/thread/TriggerCallbackThread.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/thread/TriggerCallbackThread.java @@ -76,7 +76,9 @@ public class TriggerCallbackThread { } } } catch (Exception e) { - logger.error(e.getMessage(), e); + if (!toStop) { + logger.error(e.getMessage(), e); + } } } @@ -88,7 +90,9 @@ public class TriggerCallbackThread { doCallback(callbackParamList); } } catch (Exception e) { - logger.error(e.getMessage(), e); + if (!toStop) { + logger.error(e.getMessage(), e); + } } logger.info(">>>>>>>>>>> xxl-job, executor callback thread destory.");