修复zlm离线时误报设备离线

pull/295/head
648540858 2021-12-20 10:19:05 +08:00
parent 2385f4b30c
commit 344692640c
2 changed files with 3 additions and 1 deletions

View File

@ -57,7 +57,7 @@ public class KeepaliveTimeoutListenerForPlatform extends KeyExpirationEventMessa
String platformGBId = expiredKey.substring(PLATFORM_REGISTER_PREFIX.length(),expiredKey.length()); String platformGBId = expiredKey.substring(PLATFORM_REGISTER_PREFIX.length(),expiredKey.length());
publisher.platformNotRegisterEventPublish(platformGBId); publisher.platformNotRegisterEventPublish(platformGBId);
}else{ }else if (expiredKey.startsWith(KEEPLIVEKEY_PREFIX)){
String deviceId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length()); String deviceId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length());
publisher.outlineEventPublish(deviceId, KEEPLIVEKEY_PREFIX); publisher.outlineEventPublish(deviceId, KEEPLIVEKEY_PREFIX);
} }

View File

@ -58,12 +58,14 @@ public class ZLMKeepliveTimeoutListener extends KeyExpirationEventMessageListene
} }
String mediaServerId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length()); String mediaServerId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length());
logger.info("[zlm心跳到期]" + mediaServerId);
// 发起http请求验证zlm是否确实无法连接如果确实无法连接则发送离线事件否则不作处理 // 发起http请求验证zlm是否确实无法连接如果确实无法连接则发送离线事件否则不作处理
MediaServerItem mediaServerItem = mediaServerService.getOne(mediaServerId); MediaServerItem mediaServerItem = mediaServerService.getOne(mediaServerId);
JSONObject mediaServerConfig = zlmresTfulUtils.getMediaServerConfig(mediaServerItem); JSONObject mediaServerConfig = zlmresTfulUtils.getMediaServerConfig(mediaServerItem);
if (mediaServerConfig == null) { if (mediaServerConfig == null) {
publisher.zlmOfflineEventPublish(mediaServerId); publisher.zlmOfflineEventPublish(mediaServerId);
}else { }else {
logger.info("[zlm心跳到期]{}验证后zlm仍在线回复心跳信息", mediaServerId);
// 添加zlm信息 // 添加zlm信息
mediaServerService.updateMediaServerKeepalive(mediaServerId, mediaServerConfig); mediaServerService.updateMediaServerKeepalive(mediaServerId, mediaServerConfig);
} }