Commit 9e2630ee32cf98b7191b8034eabc8f8dd105b22b
1 parent
6e90050d
增加zlm心跳超时的判定时间
Showing
2 changed files
with
6 additions
and
3 deletions
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
| ... | ... | @@ -405,7 +405,7 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 405 | 405 | } |
| 406 | 406 | final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + serverItem.getId(); |
| 407 | 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 | 409 | publisher.zlmOnlineEventPublish(serverItem.getId()); |
| 410 | 410 | logger.info("[ZLM] 连接成功 {} - {}:{} ", |
| 411 | 411 | zlmServerConfig.getGeneralMediaServerId(), zlmServerConfig.getIp(), zlmServerConfig.getHttpPort()); |
| ... | ... | @@ -438,6 +438,8 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 438 | 438 | @Override |
| 439 | 439 | public void zlmServerOffline(String mediaServerId) { |
| 440 | 440 | delete(mediaServerId); |
| 441 | + final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerId; | |
| 442 | + dynamicTask.stop(zlmKeepaliveKey); | |
| 441 | 443 | } |
| 442 | 444 | |
| 443 | 445 | @Override |
| ... | ... | @@ -657,7 +659,7 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 657 | 659 | } |
| 658 | 660 | final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerItem.getId(); |
| 659 | 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 | 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 | 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 | 184 | commanderForPlatform.unregister(parentPlatform, null, null); |
| 184 | 185 | } |
| 185 | 186 | return null; | ... | ... |