JettyServer关闭逻辑优化,修复执行器无法通过脚本正常关闭的问题

v1.7
xueli.xue 8 years ago
parent cafe9546cd
commit f0b46e12d1

@ -44,7 +44,7 @@ public class JettyServer {
logger.info(">>>>>>>>>>>> xxl-job jetty server start success at port:{}.", port); logger.info(">>>>>>>>>>>> xxl-job jetty server start success at port:{}.", port);
ExecutorRegistryThread.getInstance().start(port, ip, appName, registHelper); ExecutorRegistryThread.getInstance().start(port, ip, appName, registHelper);
server.join(); // block until thread stopped server.join(); // block until thread stopped
logger.info(">>>>>>>>>>> xxl-rpc server start success, netcon={}, port={}", JettyServer.class.getName(), port); logger.info(">>>>>>>>>>> xxl-rpc server join success, netcon={}, port={}", JettyServer.class.getName(), port);
} catch (Exception e) { } catch (Exception e) {
logger.error("", e); logger.error("", e);
} finally { } finally {
@ -59,6 +59,7 @@ public class JettyServer {
public void destroy() { public void destroy() {
if (server != null) { if (server != null) {
try { try {
server.stop();
server.destroy(); server.destroy();
} catch (Exception e) { } catch (Exception e) {
logger.error("", e); logger.error("", e);

Loading…
Cancel
Save