修复REDIS更新推流设备状态

This commit is contained in:
648540858
2024-09-19 17:21:38 +08:00
parent 89650c6d89
commit 77f1dfb6d6
5 changed files with 35 additions and 9 deletions

View File

@@ -451,10 +451,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
public void offline(List<StreamPushItemFromRedis> offlineStreams) {
// 更新部分设备离线
List<StreamPush> streamPushList = streamPushMapper.getListFromRedis(offlineStreams);
List<CommonGBChannel> commonGBChannelList = new ArrayList<>();
for (StreamPush onlinePusher : streamPushList) {
commonGBChannelList.add(onlinePusher.buildCommonGBChannel());
}
List<CommonGBChannel> commonGBChannelList = gbChannelService.queryListByStreamPushList(streamPushList);
gbChannelService.offline(commonGBChannelList);
}
@@ -462,16 +459,12 @@ public class StreamPushServiceImpl implements IStreamPushService {
public void online(List<StreamPushItemFromRedis> onlineStreams) {
// 更新部分设备上线streamPushService
List<StreamPush> streamPushList = streamPushMapper.getListFromRedis(onlineStreams);
List<CommonGBChannel> commonGBChannelList = new ArrayList<>();
for (StreamPush onlinePusher : streamPushList) {
commonGBChannelList.add(onlinePusher.buildCommonGBChannel());
}
List<CommonGBChannel> commonGBChannelList = gbChannelService.queryListByStreamPushList(streamPushList);
gbChannelService.online(commonGBChannelList);
}
@Override
public List<String> getAllAppAndStream() {
return streamPushMapper.getAllAppAndStream();
}