临时提交
parent
e46ad4e66a
commit
78088ba53f
|
@ -429,11 +429,29 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||||
}
|
}
|
||||||
streamProxyMapper.add(streamProxy);
|
streamProxyMapper.add(streamProxy);
|
||||||
if (streamProxy.isEnable()) {
|
if (streamProxy.isEnable()) {
|
||||||
// start()
|
return startProxy(streamProxy);
|
||||||
}
|
}
|
||||||
return null;
|
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 * * * ?")
|
// @Scheduled(cron = "* 0/10 * * * ?")
|
||||||
// public void asyncCheckStreamProxyStatus() {
|
// public void asyncCheckStreamProxyStatus() {
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue