diff options
Diffstat (limited to 'patches/server/0018-Paper-Metrics.patch')
-rw-r--r-- | patches/server/0018-Paper-Metrics.patch | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/patches/server/0018-Paper-Metrics.patch b/patches/server/0018-Paper-Metrics.patch index 9ad0f5d70e..fbc1a647d0 100644 --- a/patches/server/0018-Paper-Metrics.patch +++ b/patches/server/0018-Paper-Metrics.patch @@ -15,10 +15,10 @@ decisions on behalf of the project. diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java new file mode 100644 -index 0000000000000000000000000000000000000000..6aaed8e8bf8c721fc834da5c76ac72a4c3e92458 +index 0000000000000000000000000000000000000000..8f62879582195d8ae4f64bd23f752fa133b1c973 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/Metrics.java -@@ -0,0 +1,678 @@ +@@ -0,0 +1,682 @@ +package com.destroystokyo.paper; + +import net.minecraft.server.MinecraftServer; @@ -113,7 +113,11 @@ index 0000000000000000000000000000000000000000..6aaed8e8bf8c721fc834da5c76ac72a4 + * Starts the Scheduler which submits our data every 30 minutes. + */ + private void startSubmitting() { -+ final Runnable submitTask = this::submitData; ++ final Runnable submitTask = () -> { ++ if (!MinecraftServer.getServer().hasStopped()) { ++ submitData(); ++ } ++ }; + + // Many servers tend to restart at a fixed time at xx:00 which causes an uneven distribution of requests on the + // bStats backend. To circumvent this problem, we introduce some randomness into the initial and second delay. |