diff --git a/registry/registry-nacos/src/main/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistryHelper.java b/registry/registry-nacos/src/main/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistryHelper.java index bd627c5c0..2629b2a8e 100644 --- a/registry/registry-nacos/src/main/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistryHelper.java +++ b/registry/registry-nacos/src/main/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistryHelper.java @@ -128,7 +128,7 @@ static List convertInstancesToProviders(List allInstance // Nacos的默认权重为1.0 // 当Nacos默认权重传入1.0,根据代码逻辑计算结果为100,与sofa-rpc默认权重一致 // 因为是接口级别,如果不同的服务具有不同的权重也不会出现被覆盖或者冲突的情况 - if (nacosWeight > 0.0) { + if (nacosWeight >= 0.0) { long weight = Math.round(providerInfo.getWeight() * nacosWeight); providerInfo.setWeight((int) weight); }