From 13ce7d90c4bb805c5f717157ad48499517f0f4ae Mon Sep 17 00:00:00 2001 From: Govindas Date: Wed, 25 Nov 2020 13:18:23 +0200 Subject: [PATCH] Fix rare error on disable --- .../java/net/limework/rediskript/managers/RedisManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/limework/rediskript/managers/RedisManager.java b/src/main/java/net/limework/rediskript/managers/RedisManager.java index 852f999..ad85352 100644 --- a/src/main/java/net/limework/rediskript/managers/RedisManager.java +++ b/src/main/java/net/limework/rediskript/managers/RedisManager.java @@ -70,7 +70,7 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable { @Override public void run() { - while (!isShuttingDown.get()) { + while (!isShuttingDown.get() && plugin.isEnabled()) { try { plugin.getLogger().info(ChatColor.translateAlternateColorCodes('&', "&cConnecting to redis...")); if (!this.subscribeJedis.isConnected()) this.subscribeJedis = this.jedisPool.getResource(); @@ -155,6 +155,7 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable { this.subscribeJedis.getClient().close(); this.jedisPool.getResource().close(); } + isShuttingDown.set(true); this.RedisReconnector.shutdown(); this.RedisService.shutdown(); this.RedisService = null;