Merge pull request #87 from iwangjie/bugfix/20220125/issue86

修复 #86
pull/89/head
龙台 Long Tai 3 years ago committed by GitHub
commit 94f3216d58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -27,6 +27,7 @@ import cn.hippo4j.starter.toolkit.IdentifyUtil;
import cn.hippo4j.starter.toolkit.inet.InetUtils;
import cn.hutool.core.util.IdUtil;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
@ -142,13 +143,7 @@ public class DynamicThreadPoolAutoConfiguration {
@Bean
@ConditionalOnBean(name = "tomcatServletWebServerFactory")
public TomcatWebThreadPoolHandler tomcatWebThreadPoolHandler() {
ServletWebServerApplicationContext applicationContext = null;
try {
applicationContext = ApplicationContextHolder.getBean(ServletWebServerApplicationContext.class);
} catch (Exception ex) {
// ignore
}
public TomcatWebThreadPoolHandler tomcatWebThreadPoolHandler(@Autowired(required = false) ServletWebServerApplicationContext applicationContext) {
return new TomcatWebThreadPoolHandler(applicationContext);
}

Loading…
Cancel
Save