From 8a3f624d7a6f4b4c58b8204de7459b5fdeb5fce1 Mon Sep 17 00:00:00 2001 From: Keuin Date: Mon, 23 Oct 2023 02:47:20 +0800 Subject: bugfix: writer thread does not stop on server shutdown --- gradle.properties | 2 +- src/main/java/com/keuin/blame/SubmitWorker.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 54856a8..165fd17 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ minecraft_version=1.16.5 yarn_mappings=1.16.5+build.10 loader_version=0.14.23 # Mod Properties -mod_version=2.0.1 +mod_version=2.0.2 maven_group=com.keuin.blame archives_base_name=blame-fabric # Dependencies diff --git a/src/main/java/com/keuin/blame/SubmitWorker.java b/src/main/java/com/keuin/blame/SubmitWorker.java index a704c7b..103fc9c 100644 --- a/src/main/java/com/keuin/blame/SubmitWorker.java +++ b/src/main/java/com/keuin/blame/SubmitWorker.java @@ -150,6 +150,9 @@ public class SubmitWorker { var result = work(client, req, batchBuffer, writeImmediately); switch (result) { case CONTINUE -> { + if (isStopped.get()) { + return; + } writeImmediately = false; } case RECONNECT -> { -- cgit v1.2.3