mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-06 07:02:18 -07:00
Make watchdoge disabler its own patch file
Change implementation, smaller diff, less NPE
This commit is contained in:
@@ -58,14 +58,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
this.timeoutTime = timeoutTime;
|
this.timeoutTime = timeoutTime;
|
||||||
this.restart = restart;
|
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
|
@@ -0,0 +0,0 @@ public class WatchdogThread extends Thread
|
||||||
{
|
{
|
||||||
Logger log = Bukkit.getServer().getLogger();
|
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!" );
|
||||||
|
--
|
Reference in New Issue
Block a user