Browse Source

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

648540858 2 years ago
parent
commit
33d4107d0c

+ 3 - 4
src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java

@@ -14,9 +14,6 @@ import org.springframework.boot.CommandLineRunner;
 import org.springframework.core.annotation.Order;
 import org.springframework.stereotype.Component;
 
-import javax.sip.InvalidArgumentException;
-import javax.sip.SipException;
-import java.text.ParseException;
 import java.util.List;
 
 /**
@@ -61,8 +58,10 @@ public class SipPlatformRunner implements CommandLineRunner {
                     sipCommanderForPlatform.unregister(parentPlatform, parentPlatformCatchOld.getSipTransactionInfo(), null, (eventResult)->{
                         platformService.login(parentPlatform);
                     });
-                } catch (InvalidArgumentException | ParseException | SipException e) {
+                } catch (Exception e) {
                     logger.error("[命令发送失败] 国标级联 注销: {}", e.getMessage());
+                    platformService.offline(parentPlatform, true);
+                    continue;
                 }
             }
 

+ 1 - 1
src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java

@@ -276,7 +276,7 @@ public class PlatformServiceImpl implements IPlatformService {
                         eventResult.statusCode, eventResult.msg);
                 offline(parentPlatform, false);
             }, null);
-        } catch (InvalidArgumentException | ParseException | SipException e) {
+        } catch (Exception e) {
             logger.error("[命令发送失败] 国标级联定时注册: {}", e.getMessage());
         }
     }