mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Make watchdoge disabler its own patch file
Change implementation, smaller diff, less NPE
This commit is contained in:
parent
6025355569
commit
f30c245be2
@ -58,14 +58,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.timeoutTime = timeoutTime;
|
||||
this.restart = restart;
|
||||
}
|
||||
|
||||
public static void doStart(int timeoutTime, boolean restart)
|
||||
{
|
||||
- if ( instance == null )
|
||||
+ if ( !Boolean.getBoolean("disable.watchdog") && instance == null ) // Paper - Add property to disable
|
||||
{
|
||||
instance = new WatchdogThread( timeoutTime * 1000L, restart );
|
||||
instance.start();
|
||||
@@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
|
||||
{
|
||||
Logger log = Bukkit.getServer().getLogger();
|
||||
|
@ -0,0 +1,20 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
||||
Date: Thu, 12 May 2016 23:02:58 -0500
|
||||
Subject: [PATCH] System property for disabling watchdoge
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
|
||||
while ( !stopping )
|
||||
{
|
||||
//
|
||||
- if ( lastTick != 0 && System.currentTimeMillis() > lastTick + timeoutTime )
|
||||
+ if ( lastTick != 0 && System.currentTimeMillis() > lastTick + timeoutTime && !Boolean.getBoolean("disable.watchdog")) // Paper - Add property to disable
|
||||
{
|
||||
Logger log = Bukkit.getServer().getLogger();
|
||||
log.log( Level.SEVERE, "The server has stopped responding!" );
|
||||
--
|
Loading…
Reference in New Issue
Block a user