From 2e9309ab9ad3fa4c654382793d5ce42ecccce785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=88=E9=93=AD?= Date: Tue, 26 Mar 2024 16:29:25 +0800 Subject: [PATCH] support FastjsonUtils --- .../com/alipay/sofa/rpc/registry/nacos/NacosRegistryHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }