From 15708849df5966f9fe6bd3b0c7d56c199ccac55a Mon Sep 17 00:00:00 2001 From: linwl <304115325@qq.com> Date: Thu, 25 Feb 2021 10:41:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E6=95=B0=E7=BA=BF=E7=A8=8B=E5=A4=84?= =?UTF-8?q?=E7=90=86=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/SchedulingExecutorConfig.java | 40 ------------------- 1 file changed, 40 deletions(-) delete mode 100644 src/main/java/com/telpo/iotgateway/config/SchedulingExecutorConfig.java diff --git a/src/main/java/com/telpo/iotgateway/config/SchedulingExecutorConfig.java b/src/main/java/com/telpo/iotgateway/config/SchedulingExecutorConfig.java deleted file mode 100644 index 5a757ee..0000000 --- a/src/main/java/com/telpo/iotgateway/config/SchedulingExecutorConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.telpo.iotgateway.config; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.SchedulingConfigurer; -import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; -import org.springframework.scheduling.config.ScheduledTaskRegistrar; - -/** - * @program: DataPushServer - * @description: 定时任务线程配置 - * @author: linwl - * @create: 2020-07-24 10:53 - */ -@Configuration -public class SchedulingExecutorConfig implements SchedulingConfigurer { - - @Value("${scheduler.pool.size}") - private int pollSize; - - @Value("${scheduler.pool.await-seconds}") - private int awaitSeconds; - - @Override - public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { - ThreadPoolTaskScheduler taskScheduler = taskScheduler(); - taskRegistrar.setTaskScheduler(taskScheduler); - } - - @Bean(destroyMethod = "shutdown", name = "taskScheduler") - public ThreadPoolTaskScheduler taskScheduler() { - ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); - scheduler.setPoolSize(pollSize); - scheduler.setThreadNamePrefix("task-"); - scheduler.setAwaitTerminationSeconds(awaitSeconds); - scheduler.setWaitForTasksToCompleteOnShutdown(true); - return scheduler; - } -}