|
|
@ -46,8 +46,7 @@ import java.util.*; |
|
|
|
* 媒体服务器节点管理 |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
@Order(value=2) |
|
|
|
public class MediaServerServiceImpl implements IMediaServerService, CommandLineRunner { |
|
|
|
public class MediaServerServiceImpl implements IMediaServerService { |
|
|
|
|
|
|
|
private final static Logger logger = LoggerFactory.getLogger(MediaServerServiceImpl.class); |
|
|
|
|
|
|
@ -102,9 +101,8 @@ public class MediaServerServiceImpl implements IMediaServerService, CommandLineR |
|
|
|
* 初始化 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void run(String... args) throws Exception { |
|
|
|
public void updateVmServer(List<MediaServerItem> mediaServerItemList) { |
|
|
|
logger.info("[缓存初始化] Media Server "); |
|
|
|
List<MediaServerItem> mediaServerItemList = mediaServerMapper.queryAll(); |
|
|
|
for (MediaServerItem mediaServerItem : mediaServerItemList) { |
|
|
|
if (StringUtils.isEmpty(mediaServerItem.getId())) { |
|
|
|
continue; |
|
|
@ -225,7 +223,8 @@ public class MediaServerServiceImpl implements IMediaServerService, CommandLineR |
|
|
|
String key = (String) mediaServerKey; |
|
|
|
MediaServerItem mediaServerItem = (MediaServerItem) redisUtil.get(key); |
|
|
|
// 检查状态
|
|
|
|
if (redisUtil.zScore(onlineKey, mediaServerItem.getId()) != null) { |
|
|
|
Double aDouble = redisUtil.zScore(onlineKey, mediaServerItem.getId()); |
|
|
|
if (aDouble != null) { |
|
|
|
mediaServerItem.setStatus(true); |
|
|
|
} |
|
|
|
result.add(mediaServerItem); |
|
|
@ -610,6 +609,11 @@ public class MediaServerServiceImpl implements IMediaServerService, CommandLineR |
|
|
|
String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetup.getServerId() + "_" + id; |
|
|
|
redisUtil.del(key); |
|
|
|
} |
|
|
|
@Override |
|
|
|
public void deleteDb(String id){ |
|
|
|
//同步删除数据库中的数据
|
|
|
|
mediaServerMapper.delOne(id); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void updateMediaServerKeepalive(String mediaServerId, JSONObject data) { |
|
|
|