From d7a7580c4e7732efe400e91ebcfda77af88c742c Mon Sep 17 00:00:00 2001 From: xiongxiaoyang <773861846@qq.com> Date: Tue, 31 May 2022 21:17:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20XXL-JOB=20?= =?UTF-8?q?=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/github/xxyopen/novel/core/config/XxlJobConfig.java | 2 ++ src/main/resources/application.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/io/github/xxyopen/novel/core/config/XxlJobConfig.java b/src/main/java/io/github/xxyopen/novel/core/config/XxlJobConfig.java index 4084cf2..c722bed 100644 --- a/src/main/java/io/github/xxyopen/novel/core/config/XxlJobConfig.java +++ b/src/main/java/io/github/xxyopen/novel/core/config/XxlJobConfig.java @@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -15,6 +16,7 @@ import org.springframework.context.annotation.Configuration; * @date 2022/5/31 */ @Configuration +@ConditionalOnProperty(prefix = "xxl.job", name = "enable", havingValue = "true") @Slf4j public class XxlJobConfig { diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 2492763..5db5605 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -61,6 +61,8 @@ spring: # XXL-JOB 配置 xxl: job: + # 是否开启 XXL-JOB:true-开启 false-不开启 + enable: false admin: ### 调度中心部署根地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册; addresses: http://127.0.0.1:8080/xxl-job-admin