diff --git a/o2server/x_console/src/main/java/com/x/server/console/Main.java b/o2server/x_console/src/main/java/com/x/server/console/Main.java index ea623c2da401c2b6cf6e20aeb859b856788b7a8d..9cefd0c711870f1289a911cdf87446652291acbf 100644 --- a/o2server/x_console/src/main/java/com/x/server/console/Main.java +++ b/o2server/x_console/src/main/java/com/x/server/console/Main.java @@ -451,7 +451,7 @@ public class Main { if(file.exists()) { System.out.println("server will start in new process!"); Process ps = Runtime.getRuntime().exec(file.getAbsolutePath()); - Thread.sleep(1000); + Thread.sleep(2000); if(!Config.currentNode().autoStart()) { for (int i = 0; i < 5; i++) { try (Socket socket = new Socket(Config.node(), Config.currentNode().nodeAgentPort())) { @@ -485,14 +485,6 @@ public class Main { } private static void stopAllThreads(){ - if(nodeAgent!=null){ - try { - nodeAgent.stopAgent(); - nodeAgent.interrupt(); - nodeAgent = null; - } catch (Exception e) { - } - } if(swapCommandThread!=null){ try { swapCommandThread.interrupt(); @@ -505,6 +497,18 @@ public class Main { } catch (Exception e) { } } + if(nodeAgent!=null){ + try { + nodeAgent.stopAgent(); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + } + nodeAgent.interrupt(); + nodeAgent = null; + } catch (Exception e) { + } + } }