mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-23 04:28:01 +00:00
Do not poison the pubsub handler, in order to prevent shutdown hangs.
This commit is contained in:
parent
d65a316427
commit
db0ea751e9
@ -313,7 +313,7 @@ public final class RedisBungee extends Plugin implements Listener {
|
|||||||
getProxy().getPluginManager().registerListener(this, this);
|
getProxy().getPluginManager().registerListener(this, this);
|
||||||
api = new RedisBungeeAPI(this);
|
api = new RedisBungeeAPI(this);
|
||||||
psl = new PubSubListener();
|
psl = new PubSubListener();
|
||||||
new Thread(psl, "RedisBungee PubSub Listener").start();
|
getProxy().getScheduler().runAsync(this, psl);
|
||||||
getProxy().getScheduler().schedule(this, new Runnable() {
|
getProxy().getScheduler().schedule(this, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -353,7 +353,6 @@ public final class RedisBungee extends Plugin implements Listener {
|
|||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
if (pool != null) {
|
if (pool != null) {
|
||||||
// Poison the PubSub listener
|
// Poison the PubSub listener
|
||||||
psl.poison();
|
|
||||||
getProxy().getScheduler().cancel(this);
|
getProxy().getScheduler().cancel(this);
|
||||||
Jedis tmpRsc = pool.getResource();
|
Jedis tmpRsc = pool.getResource();
|
||||||
try {
|
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) {
|
public void addChannel(String... channel) {
|
||||||
jpsh.subscribe(channel);
|
jpsh.subscribe(channel);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user