From dd96c17f56278897d05a350cf8c1127597877e18 Mon Sep 17 00:00:00 2001 From: ludj Date: Wed, 22 Feb 2023 17:27:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/system/service/quartz/utils/ExecutionJob.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/ExecutionJob.java b/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/ExecutionJob.java index 7534e49..619af02 100644 --- a/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/ExecutionJob.java +++ b/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/utils/ExecutionJob.java @@ -2,6 +2,7 @@ package org.nl.system.service.quartz.utils; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; +import com.yomahub.tlog.task.quartz.TLogQuartzJobBean; import lombok.extern.slf4j.Slf4j; import org.nl.common.utils.RedisUtils; import org.nl.common.utils.SpringContextHolder; @@ -12,10 +13,10 @@ import org.nl.system.service.quartz.dao.SysQuartzJob; import org.nl.system.service.quartz.dao.SysQuartzLog; import org.nl.system.service.quartz.dao.mapper.SysQuartzLogMapper; import org.nl.system.service.quartz.impl.SysQuartzJobServiceImpl; +import org.quartz.DisallowConcurrentExecution; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.springframework.scheduling.annotation.Async; -import org.springframework.scheduling.quartz.QuartzJobBean; import java.util.concurrent.Future; import java.util.concurrent.ThreadPoolExecutor; @@ -28,14 +29,16 @@ import java.util.concurrent.ThreadPoolExecutor; @Async @SuppressWarnings({"unchecked", "all"}) @Slf4j -public class ExecutionJob extends QuartzJobBean { +@DisallowConcurrentExecution +//public class ExecutionJob extends QuartzJobBean { +public class ExecutionJob extends TLogQuartzJobBean { /** * 该处仅供参考 */ private final static ThreadPoolExecutor EXECUTOR = ThreadPoolExecutorUtil.getPoll(); @Override - protected void executeInternal(JobExecutionContext context) throws JobExecutionException { + public void executeTask(JobExecutionContext context) throws JobExecutionException { SysQuartzJob quartzJob = (SysQuartzJob) context.getMergedJobDataMap().get(SysQuartzJob.JOB_KEY); // 获取spring bean ISysQuartzJobService quartzJobService = SpringContextHolder.getBean(SysQuartzJobServiceImpl.class); @@ -99,4 +102,5 @@ public class ExecutionJob extends QuartzJobBean { } } + }