feat: 增加 XXL-JOB 开关

This commit is contained in:
xiongxiaoyang 2022-05-31 21:17:04 +08:00
parent 9eb967402a
commit d7a7580c4e
2 changed files with 4 additions and 0 deletions

View File

@ -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 {

View File

@ -61,6 +61,8 @@ spring:
# XXL-JOB 配置
xxl:
job:
# 是否开启 XXL-JOBtrue-开启 false-不开启
enable: false
admin:
### 调度中心部署根地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册;
addresses: http://127.0.0.1:8080/xxl-job-admin