|
@@ -451,7 +451,7 @@ public class Main {
|
|
|
if(file.exists()) {
|
|
if(file.exists()) {
|
|
|
System.out.println("server will start in new process!");
|
|
System.out.println("server will start in new process!");
|
|
|
Process ps = Runtime.getRuntime().exec(file.getAbsolutePath());
|
|
Process ps = Runtime.getRuntime().exec(file.getAbsolutePath());
|
|
|
- Thread.sleep(1000);
|
|
|
|
|
|
|
+ Thread.sleep(2000);
|
|
|
if(!Config.currentNode().autoStart()) {
|
|
if(!Config.currentNode().autoStart()) {
|
|
|
for (int i = 0; i < 5; i++) {
|
|
for (int i = 0; i < 5; i++) {
|
|
|
try (Socket socket = new Socket(Config.node(), Config.currentNode().nodeAgentPort())) {
|
|
try (Socket socket = new Socket(Config.node(), Config.currentNode().nodeAgentPort())) {
|
|
@@ -485,14 +485,6 @@ public class Main {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private static void stopAllThreads(){
|
|
private static void stopAllThreads(){
|
|
|
- if(nodeAgent!=null){
|
|
|
|
|
- try {
|
|
|
|
|
- nodeAgent.stopAgent();
|
|
|
|
|
- nodeAgent.interrupt();
|
|
|
|
|
- nodeAgent = null;
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
if(swapCommandThread!=null){
|
|
if(swapCommandThread!=null){
|
|
|
try {
|
|
try {
|
|
|
swapCommandThread.interrupt();
|
|
swapCommandThread.interrupt();
|
|
@@ -505,6 +497,18 @@ public class Main {
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if(nodeAgent!=null){
|
|
|
|
|
+ try {
|
|
|
|
|
+ nodeAgent.stopAgent();
|
|
|
|
|
+ try {
|
|
|
|
|
+ Thread.sleep(1000);
|
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
|
+ }
|
|
|
|
|
+ nodeAgent.interrupt();
|
|
|
|
|
+ nodeAgent = null;
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|