SteamWar/BauSystem2.0
Archiviert
12
0

Revert "Test schedule sync shutdown"
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

This reverts commit 8e3bba677e.
Dieser Commit ist enthalten in:
Lixfel 2021-10-12 16:53:50 +02:00
Ursprung 8e3bba677e
Commit 71fb547604

Datei anzeigen

@ -65,24 +65,20 @@ public class AutoShutdownListener implements Listener {
@Override @Override
public void run() { public void run() {
if (count >= 300) { if (count >= 300) {
scheduleSyncShutdown(); Bukkit.shutdown();
return; return;
} }
try { try {
if (RamUsage.getUsage() > 0.8) { if (RamUsage.getUsage() > 0.8) {
scheduleSyncShutdown(); Bukkit.shutdown();
} }
} catch (Throwable throwable) { } catch (Throwable throwable) {
Bukkit.getLogger().log(Level.WARNING, throwable.getMessage(), throwable); Bukkit.getLogger().log(Level.WARNING, throwable.getMessage(), throwable);
scheduleSyncShutdown(); Bukkit.shutdown();
} }
count++; count++;
} }
}, 20, 20); }, 20, 20);
} }
} }
private void scheduleSyncShutdown() {
Bukkit.getScheduler().runTask(BauSystem.getInstance(), Bukkit::shutdown);
}
} }