From 568762998209baaa69aab20321fe186907c5f826 Mon Sep 17 00:00:00 2001 From: o2sword <171715986@qq.com> Date: Tue, 26 Oct 2021 10:23:40 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B3=A8=E5=86=8C=E5=88=B0ce?= =?UTF-8?q?nter=E6=8A=A5timeout=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 4071a400f8b4753795d72ff42ecd889aced9f28d) --- .../console/node/RegistApplicationsEvent.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/o2server/x_console/src/main/java/com/x/server/console/node/RegistApplicationsEvent.java b/o2server/x_console/src/main/java/com/x/server/console/node/RegistApplicationsEvent.java index a8b7a3dbc0..9eb3b76712 100644 --- a/o2server/x_console/src/main/java/com/x/server/console/node/RegistApplicationsEvent.java +++ b/o2server/x_console/src/main/java/com/x/server/console/node/RegistApplicationsEvent.java @@ -9,6 +9,9 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; +import com.google.gson.JsonElement; +import com.x.base.core.project.connection.ActionResponse; +import com.x.base.core.project.jaxrs.WrapBoolean; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.eclipse.jetty.quickstart.QuickStartWebApp; @@ -67,8 +70,7 @@ public class RegistApplicationsEvent implements Event { req.setValue(gson.toJson(list)); for (Entry entry : Config.nodes().centerServers().orderedEntry()) { - CipherConnectionAction.put(false, 4000, 8000, - Config.url_x_program_center_jaxrs(entry, "center", "regist", "applications"), req); + toCenter(entry, req); } } @@ -77,6 +79,15 @@ public class RegistApplicationsEvent implements Event { } } + private void toCenter(Entry entry, Req req){ + try { + CipherConnectionAction.put(false, 2000, 4000, + Config.url_x_program_center_jaxrs(entry, "center", "regist", "applications"), req).getData(WrapBoolean.class); + } catch (Exception e) { + logger.warn("registerToCenter error:{}", e.getMessage()); + } + } + private List listApplication(Server applicationServer) throws Exception { List list = new ArrayList<>(); GzipHandler gzipHandler = (GzipHandler) applicationServer.getHandler(); @@ -199,4 +210,4 @@ public class RegistApplicationsEvent implements Event { } -} \ No newline at end of file +} -- GitLab