临时提交

pull/1642/head
648540858 2024-07-18 18:00:45 +08:00
parent e46ad4e66a
commit 78088ba53f
1 changed files with 19 additions and 1 deletions

View File

@ -429,11 +429,29 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
}
streamProxyMapper.add(streamProxy);
if (streamProxy.isEnable()) {
// start()
return startProxy(streamProxy);
}
return null;
}
private StreamInfo startProxy(StreamProxy streamProxy){
if (!streamProxy.isEnable()) {
return null;
}
MediaServer mediaServer;
String mediaServerId = streamProxy.getMediaServerId();
if (mediaServerId == null || "auto".equals(mediaServerId)) {
mediaServer = mediaServerService.getMediaServerForMinimumLoad(null);
}else {
mediaServer = mediaServerService.getOne(mediaServerId);
}
if (mediaServer == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到可用的媒体节点");
}
return mediaServerService.startProxy(mediaServer, streamProxy);
}
// @Scheduled(cron = "* 0/10 * * * ?")
// public void asyncCheckStreamProxyStatus() {
//