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

pull/1059/head
648540858 2023-09-06 10:21:42 +08:00
parent fd0ff18a71
commit 33d4107d0c
2 changed files with 4 additions and 5 deletions

View File

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

View File

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