Commit 33d4107d0c1776d730d84998c42b29933673525f

Authored by 648540858
1 parent fd0ff18a

修复启动时如果上机平台不可连接的导致的持续报错

src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java
@@ -14,9 +14,6 @@ import org.springframework.boot.CommandLineRunner; @@ -14,9 +14,6 @@ import org.springframework.boot.CommandLineRunner;
14 import org.springframework.core.annotation.Order; 14 import org.springframework.core.annotation.Order;
15 import org.springframework.stereotype.Component; 15 import org.springframework.stereotype.Component;
16 16
17 -import javax.sip.InvalidArgumentException;  
18 -import javax.sip.SipException;  
19 -import java.text.ParseException;  
20 import java.util.List; 17 import java.util.List;
21 18
22 /** 19 /**
@@ -61,8 +58,10 @@ public class SipPlatformRunner implements CommandLineRunner { @@ -61,8 +58,10 @@ public class SipPlatformRunner implements CommandLineRunner {
61 sipCommanderForPlatform.unregister(parentPlatform, parentPlatformCatchOld.getSipTransactionInfo(), null, (eventResult)->{ 58 sipCommanderForPlatform.unregister(parentPlatform, parentPlatformCatchOld.getSipTransactionInfo(), null, (eventResult)->{
62 platformService.login(parentPlatform); 59 platformService.login(parentPlatform);
63 }); 60 });
64 - } catch (InvalidArgumentException | ParseException | SipException e) { 61 + } catch (Exception e) {
65 logger.error("[命令发送失败] 国标级联 注销: {}", e.getMessage()); 62 logger.error("[命令发送失败] 国标级联 注销: {}", e.getMessage());
  63 + platformService.offline(parentPlatform, true);
  64 + continue;
66 } 65 }
67 } 66 }
68 67
src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java
@@ -276,7 +276,7 @@ public class PlatformServiceImpl implements IPlatformService { @@ -276,7 +276,7 @@ public class PlatformServiceImpl implements IPlatformService {
276 eventResult.statusCode, eventResult.msg); 276 eventResult.statusCode, eventResult.msg);
277 offline(parentPlatform, false); 277 offline(parentPlatform, false);
278 }, null); 278 }, null);
279 - } catch (InvalidArgumentException | ParseException | SipException e) { 279 + } catch (Exception e) {
280 logger.error("[命令发送失败] 国标级联定时注册: {}", e.getMessage()); 280 logger.error("[命令发送失败] 国标级联定时注册: {}", e.getMessage());
281 } 281 }
282 } 282 }