组织架构新增定时任务

This commit is contained in:
zhangchenbiao
2023-06-14 16:21:55 +08:00
parent 4596b69e68
commit a643859dc2
10 changed files with 132 additions and 5 deletions

View File

@@ -0,0 +1,58 @@
package com.cool.store.config;
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
/**
* @author zhangchenbiao
* @FileName: XxlJobConfig
* @Description: xxljob 配置信息
* @date 2021-11-12 15:26
*/
@Configuration
@ComponentScan(basePackages = "com.cool.store.job")
public class XxlJobConfig {
private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
@Value("${xxl.job.admin.addresses}")
private String adminAddresses;
@Value("${xxl.job.executor.appname}")
private String appName;
@Value("${xxl.job.executor.ip}")
private String ip;
@Value("${xxl.job.executor.port}")
private int port;
@Value("${xxl.job.accessToken}")
private String accessToken;
@Value("${xxl.job.executor.logpath}")
private String logPath;
@Value("${xxl.job.executor.logretentiondays}")
private int logRetentionDays;
@Bean
public XxlJobSpringExecutor xxlJobExecutor() {
logger.info(">>>>>>>>>>> xxl-job config init.");
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
xxlJobSpringExecutor.setAppname(appName);
xxlJobSpringExecutor.setIp(ip);
xxlJobSpringExecutor.setPort(port);
xxlJobSpringExecutor.setAccessToken(accessToken);
xxlJobSpringExecutor.setLogPath(logPath);
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
return xxlJobSpringExecutor;
}
}

View File

@@ -50,4 +50,13 @@ corp.id = 171cddee76471740
#TRTC
trtc.sdkAppId=1400811820
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
#xxljob配置
xxl.job.admin.addresses = https://djob.coolstore.cn/xxl-job-admin
xxl.job.executor.appname = ${spring.application.name}
xxl.job.executor.ip =
xxl.job.executor.port = 31001
xxl.job.executor.logpath = logs/xxl-job/jobhandler
xxl.job.executor.logretentiondays = 3
xxl.job.accessToken =

View File

@@ -51,4 +51,13 @@ corp.id = 171cddee76471740
#TRTC
trtc.sdkAppId=1400811820
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
trtc.secretKey=4854bab106c2ca2a2fda16a8c966933e28a078a34e458999d6227e8cd8ab8219
#xxljob配置
xxl.job.admin.addresses = https://djob.coolstore.cn/xxl-job-admin
xxl.job.executor.appname = ${spring.application.name}
xxl.job.executor.ip =
xxl.job.executor.port = 31001
xxl.job.executor.logpath = logs/xxl-job/jobhandler
xxl.job.executor.logretentiondays = 3
xxl.job.accessToken =