优化收到心跳设置设备上线的逻辑
This commit is contained in:
@@ -223,4 +223,11 @@ public interface IRedisCatchStorage {
|
||||
|
||||
void sendStreamPushRequestedMsg(MessageForPushChannel messageForPushChannel);
|
||||
|
||||
/**
|
||||
* 判断设备状态
|
||||
* @param deviceId 设备ID
|
||||
* @return
|
||||
*/
|
||||
public boolean deviceIsOnline(String deviceId);
|
||||
|
||||
}
|
||||
|
||||
@@ -645,4 +645,10 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
logger.info("[redis 报警通知] {}: {}", key, JSON.toJSON(msg));
|
||||
redis.convertAndSend(key, (JSONObject)JSON.toJSON(msg));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deviceIsOnline(String deviceId) {
|
||||
String key = VideoManagerConstants.KEEPLIVEKEY_PREFIX + userSetting.getServerId() + "_" + deviceId;
|
||||
return redis.hasKey(key);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user