|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: MrHua269 <wangxyper@163.com> |
| 3 | +Date: Tue, 31 Dec 2024 21:23:37 +0800 |
| 4 | +Subject: [PATCH] Add config for watchdog timeout |
| 5 | + |
| 6 | + |
| 7 | +diff --git a/src/main/java/io/papermc/paper/threadedregions/FoliaWatchdogThread.java b/src/main/java/io/papermc/paper/threadedregions/FoliaWatchdogThread.java |
| 8 | +index 258d82ab2c78482e1561343e8e1f81fc33f1895e..967107c0f4a18a29877883ccddb4d7962f4b5788 100644 |
| 9 | +--- a/src/main/java/io/papermc/paper/threadedregions/FoliaWatchdogThread.java |
| 10 | ++++ b/src/main/java/io/papermc/paper/threadedregions/FoliaWatchdogThread.java |
| 11 | +@@ -65,7 +65,7 @@ public final class FoliaWatchdogThread extends Thread { |
| 12 | + |
| 13 | + for (final RunningTick tick : ticks) { |
| 14 | + final long elapsed = now - tick.lastPrint; |
| 15 | +- if (elapsed <= TimeUnit.SECONDS.toNanos(5L)) { |
| 16 | ++ if (elapsed <= TimeUnit.MILLISECONDS.toNanos(me.earthme.luminol.config.modules.misc.FoliaWatchogConfig.tickRegionTimeOutMs)) { // Luminol - Add config for watchdog timeout |
| 17 | + continue; |
| 18 | + } |
| 19 | + tick.lastPrint = now; |
| 20 | +diff --git a/src/main/java/me/earthme/luminol/config/modules/misc/FoliaWatchogConfig.java b/src/main/java/me/earthme/luminol/config/modules/misc/FoliaWatchogConfig.java |
| 21 | +new file mode 100644 |
| 22 | +index 0000000000000000000000000000000000000000..de58b5bf9dedf35bc56a9211d0769b988704a7fe |
| 23 | +--- /dev/null |
| 24 | ++++ b/src/main/java/me/earthme/luminol/config/modules/misc/FoliaWatchogConfig.java |
| 25 | +@@ -0,0 +1,20 @@ |
| 26 | ++package me.earthme.luminol.config.modules.misc; |
| 27 | ++ |
| 28 | ++import me.earthme.luminol.config.ConfigInfo; |
| 29 | ++import me.earthme.luminol.config.EnumConfigCategory; |
| 30 | ++import me.earthme.luminol.config.IConfigModule; |
| 31 | ++ |
| 32 | ++public class FoliaWatchogConfig implements IConfigModule { |
| 33 | ++ @ConfigInfo(baseName = "tick_region_time_out_ms") |
| 34 | ++ public static int tickRegionTimeOutMs = 5000; |
| 35 | ++ |
| 36 | ++ @Override |
| 37 | ++ public EnumConfigCategory getCategory() { |
| 38 | ++ return EnumConfigCategory.MISC; |
| 39 | ++ } |
| 40 | ++ |
| 41 | ++ @Override |
| 42 | ++ public String getBaseName() { |
| 43 | ++ return "folia_watchdog"; |
| 44 | ++ } |
| 45 | ++} |
0 commit comments