Commit 344692640c0f57a6ac43552f968c76cb082b7a36
1 parent
2385f4b3
修复zlm离线时误报设备离线
Showing
2 changed files
with
3 additions
and
1 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/event/offline/KeepaliveTimeoutListenerForPlatform.java
| ... | ... | @@ -57,7 +57,7 @@ public class KeepaliveTimeoutListenerForPlatform extends KeyExpirationEventMessa |
| 57 | 57 | String platformGBId = expiredKey.substring(PLATFORM_REGISTER_PREFIX.length(),expiredKey.length()); |
| 58 | 58 | |
| 59 | 59 | publisher.platformNotRegisterEventPublish(platformGBId); |
| 60 | - }else{ | |
| 60 | + }else if (expiredKey.startsWith(KEEPLIVEKEY_PREFIX)){ | |
| 61 | 61 | String deviceId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length()); |
| 62 | 62 | publisher.outlineEventPublish(deviceId, KEEPLIVEKEY_PREFIX); |
| 63 | 63 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMKeepliveTimeoutListener.java
| ... | ... | @@ -58,12 +58,14 @@ public class ZLMKeepliveTimeoutListener extends KeyExpirationEventMessageListene |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | String mediaServerId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length()); |
| 61 | + logger.info("[zlm心跳到期]:" + mediaServerId); | |
| 61 | 62 | // 发起http请求验证zlm是否确实无法连接,如果确实无法连接则发送离线事件,否则不作处理 |
| 62 | 63 | MediaServerItem mediaServerItem = mediaServerService.getOne(mediaServerId); |
| 63 | 64 | JSONObject mediaServerConfig = zlmresTfulUtils.getMediaServerConfig(mediaServerItem); |
| 64 | 65 | if (mediaServerConfig == null) { |
| 65 | 66 | publisher.zlmOfflineEventPublish(mediaServerId); |
| 66 | 67 | }else { |
| 68 | + logger.info("[zlm心跳到期]:{}验证后zlm仍在线,回复心跳信息", mediaServerId); | |
| 67 | 69 | // 添加zlm信息 |
| 68 | 70 | mediaServerService.updateMediaServerKeepalive(mediaServerId, mediaServerConfig); |
| 69 | 71 | } | ... | ... |