Skip to content

Commit 02fba8a

Browse files
committed
🐛 启动时代理出错不影响项目运行
1 parent dab6a0b commit 02fba8a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

api-boot-project/api-boot-autoconfigure/src/main/java/org/minbox/framework/api/boot/autoconfigure/ssh/SshAgentServletContextListener.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,13 @@ public void contextInitialized(ServletContextEvent sce) {
5454
return;
5555
}
5656
configs.stream().forEach(config -> {
57-
AgentConnection connection = new DefaultAgentConnection(config);
58-
this.connections.add(connection);
59-
connection.connect();
57+
try {
58+
AgentConnection connection = new DefaultAgentConnection(config);
59+
this.connections.add(connection);
60+
connection.connect();
61+
} catch (Exception e) {
62+
log.error("Connection:{}:{},try agent failure.", config.getServerIp(), config.getForwardTargetPort(), e);
63+
}
6064
});
6165
}
6266

0 commit comments

Comments
 (0)