diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/utils/UtilAndComs.java b/client/src/main/java/com/alibaba/nacos/client/naming/utils/UtilAndComs.java index 32ff781b1..75a76ae49 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/utils/UtilAndComs.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/utils/UtilAndComs.java @@ -58,8 +58,6 @@ public class UtilAndComs { .availableProcessors() > 1 ? Runtime.getRuntime().availableProcessors() / 2 : 1; - public static final int DEFAULT_RESEND_BEAT_INTERVAL_SECONDS = 2; - public static final String HTTP = "http://"; public static final String HTTPS = "https://"; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/InstanceController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/InstanceController.java index f2c59dba5..3cd1e9fc9 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/InstanceController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/InstanceController.java @@ -267,9 +267,7 @@ public class InstanceController { } if (clientBeat != null) { - if (StringUtils.isBlank(clientBeat.getCluster())) { - clientBeat.setCluster(UtilsAndCommons.DEFAULT_CLUSTER_NAME); - } else { + if (StringUtils.isNotBlank(clientBeat.getCluster())) { clusterName = clientBeat.getCluster(); } ip = clientBeat.getIp(); @@ -311,10 +309,8 @@ public class InstanceController { clientBeat.setIp(ip); clientBeat.setPort(port); clientBeat.setCluster(clusterName); - service.processClientBeat(clientBeat); - } else { - service.processClientBeat(clientBeat); } + service.processClientBeat(clientBeat); result.put(CommonParams.CODE, NamingResponseCode.OK); result.put("clientBeatInterval", instance.getInstanceHeartBeatInterval()); diff --git a/test/src/test/java/com/alibaba/nacos/test/naming/AutoDeregisterInstance_ITCase.java b/test/src/test/java/com/alibaba/nacos/test/naming/AutoDeregisterInstance_ITCase.java index 4bbec8e80..55baf0c67 100644 --- a/test/src/test/java/com/alibaba/nacos/test/naming/AutoDeregisterInstance_ITCase.java +++ b/test/src/test/java/com/alibaba/nacos/test/naming/AutoDeregisterInstance_ITCase.java @@ -202,8 +202,6 @@ public class AutoDeregisterInstance_ITCase { String serviceName = randomDomainName(); - System.out.println(serviceName); - naming.registerInstance(serviceName, "127.0.0.1", TEST_PORT, "c1"); naming.registerInstance(serviceName, "127.0.0.2", TEST_PORT, "c2"); diff --git a/test/src/test/java/com/alibaba/nacos/test/naming/ClientBeat_ITCase.java b/test/src/test/java/com/alibaba/nacos/test/naming/ClientBeat_ITCase.java index 38616c5cc..c2fd56bfe 100644 --- a/test/src/test/java/com/alibaba/nacos/test/naming/ClientBeat_ITCase.java +++ b/test/src/test/java/com/alibaba/nacos/test/naming/ClientBeat_ITCase.java @@ -89,7 +89,7 @@ public class ClientBeat_ITCase extends NamingBase { } } - // Sleep 30 seconds and see if instance list not changed: + // Sleep 35 seconds and see if instance list not changed: TimeUnit.SECONDS.sleep(35L); list = naming.getAllInstances(serviceName); @@ -114,7 +114,7 @@ public class ClientBeat_ITCase extends NamingBase { Assert.assertTrue(response.getStatusCode().is2xxSuccessful()); - // Sleep 30 seconds and see if instance list not changed: + // Sleep 35 seconds and see if instance list not changed: TimeUnit.SECONDS.sleep(35L); list = naming.getAllInstances(serviceName);