| New file |
| | |
| | | package org.springblade.common.config; |
| | | |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.SchedulingConfigurer; |
| | | import org.springframework.scheduling.config.ScheduledTaskRegistrar; |
| | | |
| | | import java.util.concurrent.Executors; |
| | | |
| | | /** |
| | | * 定时任务多线程配置,解决定时任务执行一次后就不执行问题 |
| | | * @author zhongrj |
| | | * @since 2021-12-14 |
| | | */ |
| | | @Configuration |
| | | @EnableScheduling |
| | | public class ScheduleConfig implements SchedulingConfigurer { |
| | | |
| | | @Override |
| | | public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) { |
| | | scheduledTaskRegistrar.setScheduler(Executors.newScheduledThreadPool(100)); |
| | | } |
| | | } |