修复平台删除时未移除心跳超时重新注册任务的问题 #1329

pull/1340/head
648540858 2024-03-04 14:32:57 +08:00
parent e932a9b824
commit 38980826f9
2 changed files with 6 additions and 10 deletions

View File

@ -7,7 +7,6 @@ import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform;
import com.genersoft.iot.vmp.gb28181.utils.SipUtils;
import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory;
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
import com.genersoft.iot.vmp.service.IMediaServerService;
@ -18,22 +17,18 @@ import com.genersoft.iot.vmp.storager.dao.*;
import com.genersoft.iot.vmp.utils.DateUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import gov.nist.javax.sip.message.SIPRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.sip.InvalidArgumentException;
import javax.sip.PeerUnavailableException;
import javax.sip.SipException;
import javax.sip.SipFactory;
import javax.sip.address.Address;
import javax.sip.address.SipURI;
import javax.sip.header.*;
import javax.sip.message.Request;
import java.text.ParseException;
import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* @author lin
@ -366,7 +361,6 @@ public class PlatformServiceImpl implements IPlatformService {
()-> registerTask(platform, null),
userSetting.getRegisterAgainAfterTime() * 1000);
}
}
}

View File

@ -239,6 +239,8 @@ public class PlatformController {
if (parentPlatformCatch == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台不存在");
}
parentPlatform.setEnable(false);
storager.updateParentPlatform(parentPlatform);
// 发送离线消息,无论是否成功都删除缓存
try {
commanderForPlatform.unregister(parentPlatform, parentPlatformCatch.getSipTransactionInfo(), (event -> {