소스 검색

fix:优化日志打印

wang.sq@aliyun.com 7 달 전
부모
커밋
3b6cd1148c
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      IMCS_CCS/Service/Impl/TaskJobService.cs
  2. 0 0
      IMCS_CCS/wwwroot/db/Tasks.json

+ 5 - 3
IMCS_CCS/Service/Impl/TaskJobService.cs

@@ -1415,8 +1415,10 @@ namespace IMCS.CCS.Service.Impl
                 foreach (Device device in devices)
                 {
                     Ping pingSender = new Ping();
+
                     // 通过ping的方式测试网络是否联通
-                    PingReply reply = pingSender.Send(device.Ip);
+                    PingReply reply = pingSender.Send(device.Ip, 1000);
+
                     if (reply.Status != IPStatus.Success)
                     {
                         Device oldDevice = await _deviceService.GetDeviceById(device.Id);
@@ -1429,7 +1431,7 @@ namespace IMCS.CCS.Service.Impl
                         }
 
                         Log.Instance.WriteLogAdd(device.Ip + ":" + device.ProtocolType + "连接失败,或已离线", LOG_TITLE_DEVICE);
-                        message = message+ "======设备连接失败,或已离线,ip:" + device.Ip + ",协议类型:" + device.ProtocolType;
+                        message = message+ "======ip:" + device.Ip + "设备连接失败,或已离线,协议类型:" + device.ProtocolType;
                         continue;
                     }
                     else
@@ -1442,7 +1444,7 @@ namespace IMCS.CCS.Service.Impl
                             await _deviceService.UpdateAndCache(oldDevice); 
                         }
                         Log.Instance.WriteLogAdd(device.Ip + ":"+ device.ProtocolType +  "连接成功", LOG_TITLE_DEVICE);
-                        message = message + "======连接成功,ip:" + device.Ip + ",协议类型:" + device.ProtocolType;
+                        message = message + "======ip:" + device.Ip + "连接成功,协议类型:" + device.ProtocolType;
                         continue;
                     }
                     Thread.Sleep(50);

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
IMCS_CCS/wwwroot/db/Tasks.json


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.