|  |  |  | 
|---|
|  |  |  | public StreamInfo save(StreamProxyItem param) { | 
|---|
|  |  |  | MediaServerItem mediaInfo; | 
|---|
|  |  |  | if (ObjectUtils.isEmpty(param.getMediaServerId()) || "auto".equals(param.getMediaServerId())){ | 
|---|
|  |  |  | mediaInfo = mediaServerService.getMediaServerForMinimumLoad(); | 
|---|
|  |  |  | mediaInfo = mediaServerService.getMediaServerForMinimumLoad(null); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | mediaInfo = mediaServerService.getOne(param.getMediaServerId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | dataSourceTransactionManager.commit(transactionStatus);     //手动提交 | 
|---|
|  |  |  | result = true; | 
|---|
|  |  |  | }catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | logger.error("未处理的异常 ", e); | 
|---|
|  |  |  | dataSourceTransactionManager.rollback(transactionStatus); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | 
|---|
|  |  |  | result = true; | 
|---|
|  |  |  | streamProxy.setEnable(true); | 
|---|
|  |  |  | updateStreamProxy(streamProxy); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | logger.info("启用代理失败: {}/{}->{}({})", app, stream, jsonObject.getString("msg"), | 
|---|
|  |  |  | streamProxy.getSrc_url() == null? streamProxy.getUrl():streamProxy.getSrc_url()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return result; | 
|---|