denny 2 gadi atpakaļ
vecāks
revīzija
8cac2e4c92
2 mainītis faili ar 16 papildinājumiem un 6 dzēšanām
  1. 13 3
      src/InteractionCenter/VinnoServerService.cs
  2. 3 3
      src/appsettings.json

+ 13 - 3
src/InteractionCenter/VinnoServerService.cs

@@ -426,7 +426,7 @@ namespace WingCloudServer.InteractionCenter
         public async Task<bool> UpdateServerInfoToCacheAsync(UpdateServerInfoRequest request)
         {            
             //这里应该是批量移除,请求参数要改
-            if (request.Codes != null  && request.Codes.Any()) 
+            if (request.Codes != null && request.Codes.Any()) 
             {
                 foreach (var code in request.Codes) 
                 {
@@ -434,6 +434,9 @@ namespace WingCloudServer.InteractionCenter
                 }
                 return true;
             }
+            else {
+                LoadDBServerInfo();
+            }
             return false;
         }     
 
@@ -449,8 +452,15 @@ namespace WingCloudServer.InteractionCenter
             var serverInformationList = new List<CacheDistributedServerInfosDTO>();
             if (request.Codes != null  && request.Codes.Any()) 
             {
-                serverInformationList = CacheMaintenance.Instance.Get<IDistributedServerInfosManager>()
-                .Where(x => request.Codes.Contains(x.Code))?.ToList();
+                foreach (var item in request.Codes)
+                {
+                    var entity = CacheMaintenance.Instance.Get<IDistributedServerInfosManager>().Get(item);
+                    if (entity != null && !string.IsNullOrEmpty(entity.Code)) 
+                    {
+                        serverInformationList.Add(entity);
+                    }
+                }
+                
             }
             else
             {

+ 3 - 3
src/appsettings.json

@@ -1,9 +1,9 @@
 {
   "General": {
     "Version": "1.0.0.0",
-    "IsDistributed": true,
-    "IsMaster": false,
-    "MasterUrl": "http://192.168.6.128:8303/"
+    "IsDistributed": false,
+    "IsMaster": true,
+    "MasterUrl": ""
   },
   "Gateway": {
     "Host": "http://192.168.6.69/"