forked from Limework/RediSkript
Fix rare error on disable
This commit is contained in:
parent
cf9da45f5d
commit
13ce7d90c4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user