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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user