Merge branch 'master' into dev_2.2.0

# Conflicts:
#	easy-retry-server/src/main/java/com/aizuda/easy/retry/server/EasyRetryServerApplication.java
#	pom.xml
This commit is contained in:
byteblogs168 2023-08-17 18:05:29 +08:00
commit d1aea178a9

View File

@ -1,6 +1,7 @@
package com.aizuda.easy.retry.server;
import com.aizuda.easy.retry.server.server.NettyHttpServer;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
@ -18,6 +19,7 @@ import java.util.concurrent.TimeUnit;
@SpringBootApplication
@EnableTransactionManagement(proxyTargetClass = true)
@Slf4j
public class EasyRetryServerApplication {
@Bean
@ -39,11 +41,13 @@ public class EasyRetryServerApplication {
// 最长自旋10秒保证nettyHttpServer启动完成
int waitCount = 0;
while (!nettyHttpServer.isStarted() || waitCount > 100) {
log.info("--------> easy-retry netty server is staring....");
TimeUnit.MILLISECONDS.sleep(100);
waitCount++;
}
if (!nettyHttpServer.isStarted()) {
log.error("--------> easy-retry netty server startup failure.");
// Netty启动失败停止Web服务和Spring Boot应用程序
serverFactory.getWebServer().stop();
SpringApplication.exit(SpringApplication.run(EasyRetryServerApplication.class));