You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- package com.stonedt.intelligence.config;
-
- import java.util.concurrent.Executor;
- import java.util.concurrent.Executors;
-
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.Configuration;
- import org.springframework.scheduling.annotation.EnableScheduling;
- import org.springframework.scheduling.annotation.SchedulingConfigurer;
- import org.springframework.scheduling.config.ScheduledTaskRegistrar;
-
- /**
- * 定时任务配置类
- */
- @Configuration
- @EnableScheduling
- public class ScheduleConfig implements SchedulingConfigurer {
-
- @Override
- public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
- taskRegistrar.setScheduler(taskExecutor());
- }
-
- @Bean(destroyMethod="shutdown")
- public Executor taskExecutor() {
- return Executors.newScheduledThreadPool(30);
- }
- }
|