Commit 9e2630ee32cf98b7191b8034eabc8f8dd105b22b

Authored by 648540858
1 parent 6e90050d

增加zlm心跳超时的判定时间

src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
@@ -405,7 +405,7 @@ public class MediaServerServiceImpl implements IMediaServerService { @@ -405,7 +405,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
405 } 405 }
406 final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + serverItem.getId(); 406 final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + serverItem.getId();
407 dynamicTask.stop(zlmKeepaliveKey); 407 dynamicTask.stop(zlmKeepaliveKey);
408 - dynamicTask.startDelay(zlmKeepaliveKey, new KeepAliveTimeoutRunnable(serverItem), serverItem.getHookAliveInterval() * 1000); 408 + dynamicTask.startDelay(zlmKeepaliveKey, new KeepAliveTimeoutRunnable(serverItem), (serverItem.getHookAliveInterval() + 5) * 1000);
409 publisher.zlmOnlineEventPublish(serverItem.getId()); 409 publisher.zlmOnlineEventPublish(serverItem.getId());
410 logger.info("[ZLM] 连接成功 {} - {}:{} ", 410 logger.info("[ZLM] 连接成功 {} - {}:{} ",
411 zlmServerConfig.getGeneralMediaServerId(), zlmServerConfig.getIp(), zlmServerConfig.getHttpPort()); 411 zlmServerConfig.getGeneralMediaServerId(), zlmServerConfig.getIp(), zlmServerConfig.getHttpPort());
@@ -438,6 +438,8 @@ public class MediaServerServiceImpl implements IMediaServerService { @@ -438,6 +438,8 @@ public class MediaServerServiceImpl implements IMediaServerService {
438 @Override 438 @Override
439 public void zlmServerOffline(String mediaServerId) { 439 public void zlmServerOffline(String mediaServerId) {
440 delete(mediaServerId); 440 delete(mediaServerId);
  441 + final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerId;
  442 + dynamicTask.stop(zlmKeepaliveKey);
441 } 443 }
442 444
443 @Override 445 @Override
@@ -657,7 +659,7 @@ public class MediaServerServiceImpl implements IMediaServerService { @@ -657,7 +659,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
657 } 659 }
658 final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerItem.getId(); 660 final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerItem.getId();
659 dynamicTask.stop(zlmKeepaliveKey); 661 dynamicTask.stop(zlmKeepaliveKey);
660 - dynamicTask.startDelay(zlmKeepaliveKey, new KeepAliveTimeoutRunnable(mediaServerItem), mediaServerItem.getHookAliveInterval() * 1000); 662 + dynamicTask.startDelay(zlmKeepaliveKey, new KeepAliveTimeoutRunnable(mediaServerItem), (mediaServerItem.getHookAliveInterval() + 5) * 1000);
661 } 663 }
662 664
663 private MediaServerItem getOneFromDatabase(String mediaServerId) { 665 private MediaServerItem getOneFromDatabase(String mediaServerId) {
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
@@ -179,7 +179,8 @@ public class PlatformController { @@ -179,7 +179,8 @@ public class PlatformController {
179 commanderForPlatform.register(parentPlatform, null, null); 179 commanderForPlatform.register(parentPlatform, null, null);
180 } 180 }
181 181
182 - } else if (parentPlatformOld != null && parentPlatformOld.isEnable() && !parentPlatform.isEnable()) { // 关闭启用时注销 182 + } else if (parentPlatformOld != null && parentPlatformOld.isEnable()) {
  183 + // 关闭启用时注销
183 commanderForPlatform.unregister(parentPlatform, null, null); 184 commanderForPlatform.unregister(parentPlatform, null, null);
184 } 185 }
185 return null; 186 return null;