SteamWar/SpigotCore
Archiviert
13
0

Finaler Rettungsstuss (gegen untote Server)
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Lixfel 2022-09-14 12:20:24 +02:00
Ursprung 282b258e55
Commit f2a08e0e56

Datei anzeigen

@ -54,8 +54,12 @@ public class CrashDetector {
if(mainThread.isAlive()) { if(mainThread.isAlive()) {
SWException.log("Server hung for " + (curTime - lastTick.get()) + "ms", Arrays.stream(mainThread.getStackTrace()).map(StackTraceElement::toString).collect(Collectors.joining("\n"))); SWException.log("Server hung for " + (curTime - lastTick.get()) + "ms", Arrays.stream(mainThread.getStackTrace()).map(StackTraceElement::toString).collect(Collectors.joining("\n")));
} else { } else {
SWException.log("Server thread already dead, stopping server", ""); SWException.log("Server thread already dead, unclean server stop", "Core enabled: " + Core.getInstance().isEnabled());
System.exit(0); if(Core.getInstance().isEnabled()) {
Core.getInstance().onDisable();
}
//System.exit(0); Does freeze, potential freezing issues: ConsoleRestoreHook, ApplicationShutdownHooks or DeleteOnExitHook
Runtime.getRuntime().halt(0);
} }
lastTick.set(curTime); lastTick.set(curTime);
} }