Do not poison the pubsub handler, in order to prevent shutdown hangs.

This commit is contained in:
Tux 2014-03-31 23:02:26 -04:00
parent d65a316427
commit db0ea751e9
1 changed files with 1 additions and 7 deletions

View File

@ -313,7 +313,7 @@ public final class RedisBungee extends Plugin implements Listener {
getProxy().getPluginManager().registerListener(this, this);
api = new RedisBungeeAPI(this);
psl = new PubSubListener();
new Thread(psl, "RedisBungee PubSub Listener").start();
getProxy().getScheduler().runAsync(this, psl);
getProxy().getScheduler().schedule(this, new Runnable() {
@Override
public void run() {
@ -353,7 +353,6 @@ public final class RedisBungee extends Plugin implements Listener {
public void onDisable() {
if (pool != null) {
// Poison the PubSub listener
psl.poison();
getProxy().getScheduler().cancel(this);
Jedis tmpRsc = pool.getResource();
try {
@ -633,11 +632,6 @@ public final class RedisBungee extends Plugin implements Listener {
}
}
public void poison() {
jpsh.unsubscribe();
pool.returnResource(rsc);
}
public void addChannel(String... channel) {
jpsh.subscribe(channel);
}