Commit c62a8986dd27788f4cee2a1da477868d002c4885
1 parent
cc4c4ac1
优化线程休眠异常日志
Showing
1 changed file
with
6 additions
and
1 deletions
src/main/java/com/genersoft/iot/vmp/utils/SystemInfoUtils.java
| 1 | 1 | package com.genersoft.iot.vmp.utils; |
| 2 | 2 | |
| 3 | +import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener; | |
| 4 | +import org.slf4j.Logger; | |
| 5 | +import org.slf4j.LoggerFactory; | |
| 3 | 6 | import org.springframework.util.ObjectUtils; |
| 4 | 7 | import oshi.SystemInfo; |
| 5 | 8 | import oshi.hardware.*; |
| ... | ... | @@ -21,6 +24,8 @@ import java.util.concurrent.TimeUnit; |
| 21 | 24 | */ |
| 22 | 25 | public class SystemInfoUtils { |
| 23 | 26 | |
| 27 | + private final static Logger logger = LoggerFactory.getLogger(SystemInfoUtils.class); | |
| 28 | + | |
| 24 | 29 | /** |
| 25 | 30 | * 获取cpu信息 |
| 26 | 31 | * @return |
| ... | ... | @@ -73,7 +78,7 @@ public class SystemInfoUtils { |
| 73 | 78 | try { |
| 74 | 79 | Thread.sleep(1000); |
| 75 | 80 | } catch (InterruptedException e) { |
| 76 | - throw new RuntimeException(e); | |
| 81 | + logger.error("[线程休眠失败] : {}", e.getMessage()); | |
| 77 | 82 | } |
| 78 | 83 | List<NetworkIF> afterNetworkIFs = hal.getNetworkIFs(); |
| 79 | 84 | NetworkIF afterNet = afterNetworkIFs.get(afterNetworkIFs.size() - 1); | ... | ... |