From fa9b67f245c8397a70ef7f4affabdd8e780df363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E5=8F=B0?= Date: Mon, 2 Aug 2021 21:51:27 +0800 Subject: [PATCH] =?UTF-8?q?optimize:=20=E8=B0=83=E6=95=B4=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E6=B3=A8=E5=85=A5=E9=A1=BA=E5=BA=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../starter/config/DynamicThreadPoolAutoConfiguration.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/config/DynamicThreadPoolAutoConfiguration.java b/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/config/DynamicThreadPoolAutoConfiguration.java index 7ef24b95..79076d71 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/config/DynamicThreadPoolAutoConfiguration.java +++ b/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/config/DynamicThreadPoolAutoConfiguration.java @@ -15,6 +15,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.DependsOn; /** * 动态线程池自动装配类 @@ -38,12 +39,13 @@ public class DynamicThreadPoolAutoConfiguration { } @Bean - public ApplicationContextHolder simpleApplicationContextHolder() { + public ApplicationContextHolder applicationContextHolder() { return new ApplicationContextHolder(); } @Bean - public ConfigService configService(ApplicationContextHolder holder) { + @DependsOn("applicationContextHolder") + public ConfigService configService() { return new ThreadPoolConfigService(properties); }