Zond: перезапустить процесс в случае краша
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
group = 'asys'
|
group = 'asys'
|
||||||
version = '0.7.11-SNAPSHOT'
|
version = '0.7.12-SNAPSHOT'
|
||||||
|
|
||||||
apply plugin: 'application'
|
apply plugin: 'application'
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,8 @@ public class ZondCommandHandler implements CommandHandler {
|
|||||||
killProcess();
|
killProcess();
|
||||||
});
|
});
|
||||||
code = executor.execute(commandLine);
|
code = executor.execute(commandLine);
|
||||||
} catch (ExecuteException ignore) {
|
} catch (ExecuteException e) {
|
||||||
|
code = e.getExitValue();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Shell.getInstance().getOutput().println("Exception message: " + e.getMessage());
|
Shell.getInstance().getOutput().println("Exception message: " + e.getMessage());
|
||||||
code = -99;
|
code = -99;
|
||||||
@@ -119,6 +120,9 @@ public class ZondCommandHandler implements CommandHandler {
|
|||||||
} else if (flagForceRestartProcess) {
|
} else if (flagForceRestartProcess) {
|
||||||
_try = 0;
|
_try = 0;
|
||||||
flagForceRestartProcess = false;
|
flagForceRestartProcess = false;
|
||||||
|
} else if (code != 0 && code != -99) {
|
||||||
|
Shell.getInstance().getOutput().println("[!] Try start process again...");
|
||||||
|
_try = 0;
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user