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.

ScheduleConfig.java 851 B

3 years ago
12345678910111213141516171819202122232425262728
  1. package com.stonedt.intelligence.config;
  2. import java.util.concurrent.Executor;
  3. import java.util.concurrent.Executors;
  4. import org.springframework.context.annotation.Bean;
  5. import org.springframework.context.annotation.Configuration;
  6. import org.springframework.scheduling.annotation.EnableScheduling;
  7. import org.springframework.scheduling.annotation.SchedulingConfigurer;
  8. import org.springframework.scheduling.config.ScheduledTaskRegistrar;
  9. /**
  10. * 定时任务配置类
  11. */
  12. @Configuration
  13. @EnableScheduling
  14. public class ScheduleConfig implements SchedulingConfigurer {
  15. @Override
  16. public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
  17. taskRegistrar.setScheduler(taskExecutor());
  18. }
  19. @Bean(destroyMethod="shutdown")
  20. public Executor taskExecutor() {
  21. return Executors.newScheduledThreadPool(30);
  22. }
  23. }

一款开源免费的舆情系统。 支持本地化部署,支持在线体验。 支持对海量舆情数据分析和挖掘。