From 7a008dbcc7aadbbb896b8f8964de3980e2e70829 Mon Sep 17 00:00:00 2001 From: godotg Date: Sat, 20 Jan 2024 20:34:12 +0800 Subject: [PATCH] chore[comment]: scheduler comments --- .../main/java/com/zfoo/scheduler/manager/SchedulerBus.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scheduler/src/main/java/com/zfoo/scheduler/manager/SchedulerBus.java b/scheduler/src/main/java/com/zfoo/scheduler/manager/SchedulerBus.java index e9fe5b081..25399ae2f 100644 --- a/scheduler/src/main/java/com/zfoo/scheduler/manager/SchedulerBus.java +++ b/scheduler/src/main/java/com/zfoo/scheduler/manager/SchedulerBus.java @@ -141,8 +141,10 @@ private static void triggerPerSecond() { // 到达触发时间,则执行runnable方法 try { scheduler.getScheduler().invoke(); + } catch (Exception e) { + logger.error("scheduler invoke exception", e); } catch (Throwable t) { - logger.error("scheduler任务调度未知异常", t); + logger.error("scheduler invoke error", t); } // 重新设置下一次的触发时间戳 triggerTimestamp = TimeUtils.nextTimestampByCronExpression(scheduler.getCronExpression(), timestampZonedDataTime); @@ -175,7 +177,7 @@ public static ScheduledFuture scheduleAtFixedRate(Runnable runnable, long per */ public static ScheduledFuture schedule(Runnable runnable, long delay, TimeUnit unit) { - return executor.schedule(ThreadUtils.safeRunnable(runnable), delay, unit); + return executor.schedule(ThreadUtils.safeRunnable(runnable), delay, unit); } /**