Fix rare error on disable

This commit is contained in:
Govindas 2020-11-25 13:18:23 +02:00
parent cf9da45f5d
commit 13ce7d90c4
1 changed files with 2 additions and 1 deletions

View File

@ -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;