From 1ff2a9152c5136bfa30c487281fc400d3d83f273 Mon Sep 17 00:00:00 2001 From: xu kaiwei Date: Wed, 11 Nov 2020 12:30:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=A6=82=E6=9E=9C=E4=B8=8D?= =?UTF-8?q?=E5=9C=A8=E9=BB=98=E8=AE=A4group=E4=B8=AD=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=89=BE=E4=B8=8D=E5=88=B0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Ocelot.Provider.Nacos/NacosClient/NacosServerManager.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Ocelot.Provider.Nacos/NacosClient/NacosServerManager.cs b/src/Ocelot.Provider.Nacos/NacosClient/NacosServerManager.cs index f0f9646..9067e8b 100644 --- a/src/Ocelot.Provider.Nacos/NacosClient/NacosServerManager.cs +++ b/src/Ocelot.Provider.Nacos/NacosClient/NacosServerManager.cs @@ -11,6 +11,8 @@ namespace Ocelot.Provider.Nacos.NacosClient public class NacosServerManager : INacosServerManager { private readonly INacosNamingClient _client; + IOptions _optionsAccs; + private readonly IEasyCachingProvider _provider; public NacosServerManager( @@ -19,6 +21,7 @@ namespace Ocelot.Provider.Nacos.NacosClient IOptions optionsAccs) { _client = client; + _optionsAccs = optionsAccs; _provider = factory.GetCachingProvider("nacos.aspnetcore"); } @@ -29,6 +32,8 @@ namespace Ocelot.Provider.Nacos.NacosClient var serviceInstances = await _client.ListInstancesAsync(new ListInstancesRequest { ServiceName = serviceName, + GroupName = _optionsAccs.Value.GroupName, + NamespaceId = _optionsAccs.Value.Namespace, HealthyOnly = true, });