forked from Limework/RediSkript
Fix rare error on disable
This commit is contained in:
parent
ca64ec19db
commit
afdb0c3e59
@ -70,7 +70,7 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
while (!isShuttingDown.get()) {
|
while (!isShuttingDown.get() && plugin.isEnabled()) {
|
||||||
try {
|
try {
|
||||||
plugin.getLogger().info(ChatColor.translateAlternateColorCodes('&', "&cConnecting to redis..."));
|
plugin.getLogger().info(ChatColor.translateAlternateColorCodes('&', "&cConnecting to redis..."));
|
||||||
if (!this.subscribeJedis.isConnected()) this.subscribeJedis = this.jedisPool.getResource();
|
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.subscribeJedis.getClient().close();
|
||||||
this.jedisPool.getResource().close();
|
this.jedisPool.getResource().close();
|
||||||
}
|
}
|
||||||
|
isShuttingDown.set(true);
|
||||||
this.RedisReconnector.shutdown();
|
this.RedisReconnector.shutdown();
|
||||||
this.RedisService.shutdown();
|
this.RedisService.shutdown();
|
||||||
this.RedisService = null;
|
this.RedisService = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user