Archived
0

Zond:fix: слишком частые рестары при старте сервера

This commit is contained in:
2017-08-13 16:19:15 +03:00
parent 87301cd8e9
commit 4410dd694e

View File

@@ -102,13 +102,13 @@ public class ZondCommandHandler implements CommandHandler {
server.setPingMonitor(pingMonitor); server.setPingMonitor(pingMonitor);
server.start(Config.getInstance().getInt("bridge.port")); server.start(Config.getInstance().getInt("bridge.port"));
deadTime = (System.currentTimeMillis()/1000) + (delay*1000);
pingMonitor.start(() -> { pingMonitor.start(() -> {
Shell.getInstance().getOutput().println("[!] Process - zobie?"); Shell.getInstance().getOutput().println("[!] Process - zobie?");
Shell.getInstance().getOutput().println("[!] Force shutdown process."); Shell.getInstance().getOutput().println("[!] Force shutdown process.");
flagForceRestartProcess = true; flagForceRestartProcess = true;
killProcess(); killProcess();
}); });
deadTime = (System.currentTimeMillis()/1000) + (delay*1000);
code = executor.execute(commandLine); code = executor.execute(commandLine);
} catch (ExecuteException e) { } catch (ExecuteException e) {
code = e.getExitValue(); code = e.getExitValue();
@@ -128,7 +128,7 @@ public class ZondCommandHandler implements CommandHandler {
_try = 0; _try = 0;
break; break;
} else { } else {
if (currTime <= deadTime && !flagManualKill && !flagForceRestartProcess) { if (currTime <= deadTime && !flagManualKill) {
Shell.getInstance().getOutput().println("[!] Premature end process."); Shell.getInstance().getOutput().println("[!] Premature end process.");
_try++; _try++;
if (_try < 2) { if (_try < 2) {