节点管理--某个zlm节点删除之后,数据库中仍有数据,导致再次添加该zlm节点

This commit is contained in:
chenjialing 2022-03-02 18:29:02 +08:00
parent b225b53510
commit af885ca4d9
3 changed files with 8 additions and 0 deletions

View File

@ -76,6 +76,8 @@ public interface IMediaServerService {
void delete(String id);
void deleteDb(String id);
MediaServerItem getDefaultMediaServer();
void updateMediaServerKeepalive(String mediaServerId, JSONObject data);

View File

@ -608,6 +608,11 @@ public class MediaServerServiceImpl implements IMediaServerService {
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) {

View File

@ -158,6 +158,7 @@ public class ServerController {
public WVPResult<String> deleteMediaServer(@RequestParam String id){
if (mediaServerService.getOne(id) != null) {
mediaServerService.delete(id);
mediaServerService.deleteDb(id);
}else {
WVPResult<String> result = new WVPResult<>();
result.setCode(-1);