lichunlei 8 месяцев назад
Родитель
Сommit
0469f092d7
1 измененных файлов с 1 добавлено и 7 удалено
  1. 1 7
      Util/RefreshYarp.cs

+ 1 - 7
Util/RefreshYarp.cs

@@ -17,13 +17,7 @@ public class RefreshYarp : BackgroundService
 
                 var clusters = new List<ClusterConfig>();
                 var routes   = new List<RouteConfig>();            
-                var services = new ServiceCollection();
-                services.AddNacosV2Naming(x =>
-                {
-                    InternalApp.Configuration.GetSection("NacosConfig").Bind(x);
-                });
-                var sp = services.BuildServiceProvider();
-                var naming = sp.GetRequiredService<INacosNamingService>();
+                var naming = App.ServiceProvider.GetRequiredService<INacosNamingService>();
 
                 var options = App.OptionsSetting;
                 foreach(var service in options.Services)