Update RedisManager.java
This commit is contained in:
parent
a08ecd93b7
commit
6c5d580b16
@ -60,6 +60,9 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void start() {
|
public void start() {
|
||||||
|
if (isShuttingDown.get()) {
|
||||||
|
isShuttingDown.set(false);
|
||||||
|
}
|
||||||
this.RedisService.execute(this);
|
this.RedisService.execute(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,9 +151,10 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable {
|
|||||||
this.RedisService.shutdown();
|
this.RedisService.shutdown();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reload() {
|
public void reload() {
|
||||||
|
shutdown();
|
||||||
plugin.reloadConfig();
|
plugin.reloadConfig();
|
||||||
subscribeJedis.close();
|
|
||||||
Configuration config = this.plugin.getConfig();
|
Configuration config = this.plugin.getConfig();
|
||||||
JedisPoolConfig JConfig = new JedisPoolConfig();
|
JedisPoolConfig JConfig = new JedisPoolConfig();
|
||||||
JConfig.setMaxTotal(config.getInt("Redis.MaxConnections"));
|
JConfig.setMaxTotal(config.getInt("Redis.MaxConnections"));
|
||||||
@ -163,7 +167,7 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable {
|
|||||||
config.getInt("Redis.TimeOut"),
|
config.getInt("Redis.TimeOut"),
|
||||||
config.getString("Redis.Password"),
|
config.getString("Redis.Password"),
|
||||||
config.getBoolean("Redis.useSSL"));
|
config.getBoolean("Redis.useSSL"));
|
||||||
RedisService.shutdownNow();
|
RedisService.shutdown();
|
||||||
RedisService = Executors.newFixedThreadPool(config.getInt("Redis.Threads"));
|
RedisService = Executors.newFixedThreadPool(config.getInt("Redis.Threads"));
|
||||||
try {
|
try {
|
||||||
this.subscribeJedis = this.jedisPool.getResource();
|
this.subscribeJedis = this.jedisPool.getResource();
|
||||||
@ -171,6 +175,7 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable {
|
|||||||
}
|
}
|
||||||
this.channels = config.getStringList("Channels");
|
this.channels = config.getStringList("Channels");
|
||||||
encryption = new Encryption(config);
|
encryption = new Encryption(config);
|
||||||
|
start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public JedisPool getJedisPool() {
|
public JedisPool getJedisPool() {
|
||||||
|
Loading…
Reference in New Issue
Block a user