提交 56876299 编写于 作者: O o2sword 提交者: o2null

修复注册到center报timeout错误的问题


(cherry picked from commit 4071a400)
上级 f6aa3aec
......@@ -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<String, CenterServer> 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<String, CenterServer> 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<Application> listApplication(Server applicationServer) throws Exception {
List<Application> list = new ArrayList<>();
GzipHandler gzipHandler = (GzipHandler) applicationServer.getHandler();
......@@ -199,4 +210,4 @@ public class RegistApplicationsEvent implements Event {
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册