ZhangWenTao 2 лет назад
Родитель
Сommit
1709eadfa1
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      src/main/java/com/persagy/cameractl/cache/IPCWithNVRCache.java

+ 8 - 1
src/main/java/com/persagy/cameractl/cache/IPCWithNVRCache.java

@@ -56,6 +56,13 @@ public class IPCWithNVRCache {
             try {
                 // 读取IPC信息, 构建缓存
                 for (ReqSetServerUriInfo reqSetServerUriInfo : loadNvrIpcInfo(loginHandler, nvrItem)) {
+                    if (cache.containsKey(reqSetServerUriInfo.getIp())) {
+                        log.warn("ipc ip repeat: ip-{} , nvr1-{} nvr2-{}",
+                                reqSetServerUriInfo.getIp(),
+                                cache.get(reqSetServerUriInfo.getIp()).getNvr().getIp(),
+                                nvrItem.getIp());
+                    }
+
                     cache.put(reqSetServerUriInfo.getIp(), new IPCInfo(reqSetServerUriInfo, nvrItem));
                 }
 
@@ -73,7 +80,7 @@ public class IPCWithNVRCache {
 
     private List<ReqSetServerUriInfo> loadNvrIpcInfo(WinDef.DWORD loginHandler,
                                                      NVRConfigurationProperties.NVRItem nvrItem) throws Exception {
-        int pIPCServerListSize = 4 * 1024 * 1024;
+        int pIPCServerListSize = 2 * 1024 * 1024;
         byte[] pIPCServerList = new byte[pIPCServerListSize];
         WinDef.UINTByReference nRealSizeRef = new WinDef.UINTByReference(
                 new WinDef.UINT(pIPCServerListSize));