定时任务执行及报告核心

This commit is contained in:
liangdaliang
2025-02-24 16:00:20 +08:00
parent 142252d7c6
commit 8f3e32840a
4 changed files with 204 additions and 23 deletions

View File

@@ -0,0 +1,22 @@
package com.test.common.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
/**
* @author liangdaliang
* @Description自定义定时任务配置
* @date 2025-02-24 10:27
*/
@Configuration
public class SchedulerConfig {
@Bean
public ThreadPoolTaskScheduler taskScheduler() {
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
scheduler.setPoolSize(60); // 设置线程池大小
scheduler.setThreadNamePrefix("TestTaskScheduler-");
return scheduler;
}
}