|
|
@@ -1,30 +0,0 @@
|
|
|
-package com.usoftchina.saas.transfers.task;
|
|
|
-
|
|
|
-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;
|
|
|
-
|
|
|
-import java.util.concurrent.Executor;
|
|
|
-import java.util.concurrent.Executors;
|
|
|
-
|
|
|
-/**
|
|
|
- * @author: guq
|
|
|
- * @create: 2018-12-29 09:38
|
|
|
- **/
|
|
|
-@Configuration
|
|
|
-@EnableScheduling
|
|
|
-public class TaskSchedulerConfig implements SchedulingConfigurer{
|
|
|
-
|
|
|
- @Override
|
|
|
- public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
|
|
|
- scheduledTaskRegistrar.setScheduler(taskScheduler());
|
|
|
- }
|
|
|
-
|
|
|
- @Bean(destroyMethod = "shutdown")
|
|
|
- public Executor taskScheduler() {
|
|
|
- return Executors.newScheduledThreadPool(100);
|
|
|
- }
|
|
|
-
|
|
|
-}
|