清理过期的推流鉴权信息

This commit is contained in:
648540858
2022-11-17 18:21:45 +08:00
parent 6b8ecd1f9d
commit 5f7c53823a
3 changed files with 29 additions and 0 deletions

View File

@@ -233,6 +233,8 @@ public interface IRedisCatchStorage {
*/
StreamAuthorityInfo getStreamAuthorityInfo(String app, String stream);
List<StreamAuthorityInfo> getAllStreamAuthorityInfo();
/**
* 发送redis消息 查询所有推流设备的状态
*/

View File

@@ -714,6 +714,18 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
}
@Override
public List<StreamAuthorityInfo> getAllStreamAuthorityInfo() {
String scanKey = VideoManagerConstants.MEDIA_STREAM_AUTHORITY + userSetting.getServerId() + "_*_*" ;
List<StreamAuthorityInfo> result = new ArrayList<>();
List<Object> keys = RedisUtil.scan(scanKey);
for (Object o : keys) {
String key = (String) o;
result.add((StreamAuthorityInfo) RedisUtil.get(key));
}
return result;
}
@Override
public OnStreamChangedHookParam getStreamInfo(String app, String streamId, String mediaServerId) {