Преглед изворни кода

Merge branch 'feature/增加系统重启脚本及重启命令' into 'wrdp'

[平台]集群重启命令问题修复

See merge request o2oa/o2oa!2440
o2null пре 5 година
родитељ
комит
3c47825a31
1 измењених фајлова са 13 додато и 9 уклоњено
  1. 13 9
      o2server/x_console/src/main/java/com/x/server/console/Main.java

+ 13 - 9
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) {
+			}
+		}
 
 	}