解决推流设备状态更新异常

This commit is contained in:
lin
2025-03-19 16:22:38 +08:00
parent 06de25bb4d
commit ccafa0ea01
3 changed files with 5 additions and 2 deletions

View File

@@ -373,7 +373,7 @@ public class ChannelProvider {
StringBuilder sqlBuild = new StringBuilder(); StringBuilder sqlBuild = new StringBuilder();
sqlBuild.append(BASE_SQL); sqlBuild.append(BASE_SQL);
sqlBuild.append(" where channel_type = 0 and data_type = #{dataType} and data_device_id in ( "); sqlBuild.append(" where channel_type = 0 and data_type = #{dataType} and data_device_id in ( ");
Collection<StreamPush> ids = (Collection<StreamPush>)params.get("streamPushList"); Collection<StreamPush> ids = (Collection<StreamPush>)params.get("streamPushList");
boolean first = true; boolean first = true;
for (StreamPush streamPush : ids) { for (StreamPush streamPush : ids) {

View File

@@ -92,7 +92,7 @@ public class RedisPushStreamStatusMsgListener implements MessageListener, Applic
streamPushService.online(streamStatusMessage.getOnlineStreams()); streamPushService.online(streamStatusMessage.getOnlineStreams());
} }
} catch (Exception e) { } catch (Exception e) {
log.warn("[REDIS消息-推流设备状态变化] 发现未处理的异常, \r\n{}", JSON.toJSONString(msg)); log.warn("[REDIS消息-推流设备状态变化] 发现未处理的异常, \r\n{}", JSON.parseObject(msg.getBody()));
log.error("[REDIS消息-推流设备状态变化] 异常内容: ", e); log.error("[REDIS消息-推流设备状态变化] 异常内容: ", e);
} }
} }

View File

@@ -471,6 +471,9 @@ public class StreamPushServiceImpl implements IStreamPushService {
public void online(List<StreamPushItemFromRedis> onlineStreams) { public void online(List<StreamPushItemFromRedis> onlineStreams) {
// 更新部分设备上线streamPushService // 更新部分设备上线streamPushService
List<StreamPush> streamPushList = streamPushMapper.getListFromRedis(onlineStreams); List<StreamPush> streamPushList = streamPushMapper.getListFromRedis(onlineStreams);
if (streamPushList.isEmpty()) {
return;
}
List<CommonGBChannel> commonGBChannelList = gbChannelService.queryListByStreamPushList(streamPushList); List<CommonGBChannel> commonGBChannelList = gbChannelService.queryListByStreamPushList(streamPushList);
gbChannelService.online(commonGBChannelList); gbChannelService.online(commonGBChannelList);
} }