diff --git a/api/src/main/java/com/alibaba/nacos/api/naming/pojo/ServiceInfo.java b/api/src/main/java/com/alibaba/nacos/api/naming/pojo/ServiceInfo.java index 1b5281d42c3..4d8b13da19d 100644 --- a/api/src/main/java/com/alibaba/nacos/api/naming/pojo/ServiceInfo.java +++ b/api/src/main/java/com/alibaba/nacos/api/naming/pojo/ServiceInfo.java @@ -194,7 +194,7 @@ public boolean validate() { continue; } - for (int i = 0; i < host.getWeight(); i++) { + if (host.getWeight() > 0) { validHosts.add(host); } }