From 0a5ad6b5943cd46be1098a09d9c11eb590aa8239 Mon Sep 17 00:00:00 2001 From: William Date: Thu, 22 Aug 2024 13:32:56 +0100 Subject: [PATCH] fix: make Redis subscriber thread a daemon Should auto-terminate on shutdown now --- .../java/net/william278/huskhomes/network/RedisBroker.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/net/william278/huskhomes/network/RedisBroker.java b/common/src/main/java/net/william278/huskhomes/network/RedisBroker.java index 4b5b4c4e..ce622d59 100644 --- a/common/src/main/java/net/william278/huskhomes/network/RedisBroker.java +++ b/common/src/main/java/net/william278/huskhomes/network/RedisBroker.java @@ -63,7 +63,9 @@ public void initialize() throws IllegalStateException { // Subscribe using a thread (rather than a task) subscriber.enable(jedisPool); - new Thread(subscriber::subscribe, "huskhomes:redis_subscriber").start(); + final Thread thread = new Thread(subscriber::subscribe, "huskhomes:redis_subscriber"); + thread.setDaemon(true); + thread.start(); } @NotNull