From f085095da5740c133420bd8355017164807d4c8c Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Mon, 15 Jul 2024 15:40:27 +0800 Subject: [PATCH] =?UTF-8?q?opt:=20=E7=BA=BF=E7=A8=8B=E6=B1=A0=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E5=A4=8D=E7=94=A8=E5=AF=BC=E8=87=B4=E9=93=BE=E8=B7=AF?= =?UTF-8?q?id=E7=9B=B8=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/system/service/quartz/utils/QuartzRunnable.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/system/service/quartz/utils/QuartzRunnable.java b/lms/nladmin-system/src/main/java/org/nl/system/service/quartz/utils/QuartzRunnable.java index ebfe6c8f6..72930ead9 100644 --- a/lms/nladmin-system/src/main/java/org/nl/system/service/quartz/utils/QuartzRunnable.java +++ b/lms/nladmin-system/src/main/java/org/nl/system/service/quartz/utils/QuartzRunnable.java @@ -1,12 +1,13 @@ package org.nl.system.service.quartz.utils; import cn.hutool.core.util.StrUtil; +import com.yomahub.tlog.core.thread.TLogInheritableTask; +import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.nl.modules.wql.util.SpringContextHolder; import org.springframework.util.ReflectionUtils; import java.lang.reflect.Method; -import java.util.concurrent.Callable; /** * 执行定时任务 @@ -14,7 +15,7 @@ import java.util.concurrent.Callable; * @author / */ @Slf4j -public class QuartzRunnable implements Callable { +public class QuartzRunnable extends TLogInheritableTask { private final Object target; private final Method method; @@ -32,14 +33,15 @@ public class QuartzRunnable implements Callable { } } + + @SneakyThrows @Override - public Object call() throws Exception { + public void runTask() { ReflectionUtils.makeAccessible(method); if (StrUtil.isNotEmpty(params)) { method.invoke(target, params); } else { method.invoke(target); } - return null; } }