diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/springboot/starter/core/DiscoveryClient.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/springboot/starter/core/DiscoveryClient.java index 0bc94ea3..92cb52e3 100644 --- a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/springboot/starter/core/DiscoveryClient.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/springboot/starter/core/DiscoveryClient.java @@ -92,6 +92,8 @@ public class DiscoveryClient implements DisposableBean { String clientCloseUrlPath = Constants.BASE_PATH + "/client/close"; Result clientCloseResult; try { + // close scheduledExecutor + this.scheduler.shutdown(); String groupKeyIp = new StringBuilder() .append(instanceInfo.getGroupKey()) .append(Constants.GROUP_KEY_DELIMITER) @@ -126,6 +128,9 @@ public class DiscoveryClient implements DisposableBean { private boolean renew() { Result renewResult; try { + if (this.scheduler.isShutdown()) { + return false; + } InstanceInfo.InstanceRenew instanceRenew = new InstanceInfo.InstanceRenew() .setAppName(instanceInfo.getAppName()) .setInstanceId(instanceInfo.getInstanceId())