2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2026-04-07 15:40:26 +00:00

Do not allow unsubscribing from RedisBungee internal channels and properly poison the PubSub handler this time.

This commit is contained in:
Tux
2014-11-02 14:16:41 -05:00
parent 8ac70e801f
commit d438186682
2 changed files with 19 additions and 1 deletions

View File

@@ -320,7 +320,9 @@ public final class RedisBungee extends Plugin {
public void onDisable() {
if (pool != null) {
// Poison the PubSub listener
psl.poison();
getProxy().getScheduler().cancel(this);
getLogger().info("Waiting for all tasks to finish.");
service.shutdown();
@@ -342,6 +344,7 @@ public final class RedisBungee extends Plugin {
} finally {
pool.returnResource(tmpRsc);
}
pool.destroy();
}
}
@@ -477,10 +480,13 @@ public final class RedisBungee extends Plugin {
public void removeChannel(String... channel) {
jpsh.unsubscribe(channel);
}
public void poison() {
jpsh.unsubscribe();
}
}
class JedisPubSubHandler extends JedisPubSub {
@Override
public void onMessage(final String s, final String s2) {
if (s2.trim().length() == 0) return;