Merge pull request #2367 from kashike/feature/quiet-watchdog
Skip hang detection on first run of the server hang watchdog
This commit is contained in:
commit
b8238e7f22
1 changed files with 28 additions and 0 deletions
|
@ -0,0 +1,28 @@
|
|||
--- ../src-base/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java
|
||||
+++ ../src-work/minecraft/net/minecraft/server/dedicated/ServerHangWatchdog.java
|
||||
@@ -22,6 +22,7 @@
|
||||
private static final Logger field_180251_a = LogManager.getLogger();
|
||||
private final DedicatedServer field_180249_b;
|
||||
private final long field_180250_c;
|
||||
+ private boolean firstRun = true;
|
||||
|
||||
public ServerHangWatchdog(DedicatedServer p_i46310_1_)
|
||||
{
|
||||
@@ -37,7 +38,7 @@
|
||||
long j = MinecraftServer.func_130071_aq();
|
||||
long k = j - i;
|
||||
|
||||
- if (k > this.field_180250_c)
|
||||
+ if (k > this.field_180250_c && !this.firstRun)
|
||||
{
|
||||
field_180251_a.fatal("A single server tick took " + String.format("%.2f", new Object[] {Float.valueOf((float)k / 1000.0F)}) + " seconds (should be max " + String.format("%.2f", new Object[] {Float.valueOf(0.05F)}) + ")");
|
||||
field_180251_a.fatal("Considering it to be crashed, server will forcibly shutdown.");
|
||||
@@ -75,6 +76,8 @@
|
||||
this.func_180248_a();
|
||||
}
|
||||
|
||||
+ this.firstRun = false;
|
||||
+
|
||||
try
|
||||
{
|
||||
Thread.sleep(i + this.field_180250_c - j);
|
Loading…
Reference in a new issue