optimize: 调整依赖注入顺序.

pull/161/head
龙台 3 years ago
parent 23fabc6ef1
commit fa9b67f245

@ -15,6 +15,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
/** /**
* 线 * 线
@ -38,12 +39,13 @@ public class DynamicThreadPoolAutoConfiguration {
} }
@Bean @Bean
public ApplicationContextHolder simpleApplicationContextHolder() { public ApplicationContextHolder applicationContextHolder() {
return new ApplicationContextHolder(); return new ApplicationContextHolder();
} }
@Bean @Bean
public ConfigService configService(ApplicationContextHolder holder) { @DependsOn("applicationContextHolder")
public ConfigService configService() {
return new ThreadPoolConfigService(properties); return new ThreadPoolConfigService(properties);
} }

Loading…
Cancel
Save