SteamWar/SpigotCore
Archiviert
13
0

Fix timelog in CrashDetector
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Lixfel 2024-01-18 15:31:01 +01:00
Ursprung 0c9048c346
Commit d6f1d51bad

Datei anzeigen

@ -61,11 +61,11 @@ public class CrashDetector {
while (run) {
long curTime = System.nanoTime();
if(curTime - 4*TIMEOUT >= lastTick.get()) {
SWException.log("Server did not recover in " + (curTime - lastTick.get()) + "ms, unclean server stop", "");
SWException.log("Server did not recover in " + ((curTime - lastTick.get()) / 1000000.0) + "ms, unclean server stop", "");
hardStop();
} else if(curTime - TIMEOUT > lastMessage.get()) {
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()) / 1000000.0) + "ms", Arrays.stream(mainThread.getStackTrace()).map(StackTraceElement::toString).collect(Collectors.joining("\n")));
} else {
SWException.log("Server thread already dead, unclean server stop", "Core enabled: " + Core.getInstance().isEnabled());
hardStop();