Compare commits
2 Commits
1.0.3-SNAP
...
1.0.3-fix2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f4600546e | ||
|
|
f4ab43bcb8 |
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>net.limework.core</groupId>
|
||||
<artifactId>LimeworkSpigotCore</artifactId>
|
||||
<version>1.0.3-SNAPSHOT</version>
|
||||
<version>1.0.3-fix2-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -32,6 +32,8 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable, Command
|
||||
private JedisPool jedisPool;
|
||||
private ExecutorService RedisService;
|
||||
|
||||
private AtomicBoolean isKilled = new AtomicBoolean();
|
||||
|
||||
|
||||
//sub
|
||||
private BinaryJedis subscribeJedis;
|
||||
@@ -72,6 +74,7 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable, Command
|
||||
@Override
|
||||
public void run() {
|
||||
while (!isShuttingDown.get()) {
|
||||
isKilled.set(false);
|
||||
try {
|
||||
message("&e[Jedis] &cConnecting to redis...........");
|
||||
if (!this.subscribeJedis.isConnected()) this.subscribeJedis = this.jedisPool.getResource();
|
||||
@@ -110,6 +113,7 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable, Command
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (isKilled.get()) break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,6 +183,15 @@ public class RedisManager extends BinaryJedisPubSub implements Runnable, Command
|
||||
, "&c&lYou can not execute this command!!!!!!")));
|
||||
return true;
|
||||
}
|
||||
isKilled.set(true);
|
||||
try {
|
||||
if (this.subscribeJedis != null) {
|
||||
this.unsubscribe();
|
||||
this.subscribeJedis.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
start();
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user