mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-23 04:28:01 +00:00
Handle shutdown more gracefully.
This commit is contained in:
parent
49c8b83e52
commit
8da933a585
@ -196,6 +196,17 @@ public class RedisBungee extends Plugin implements Listener {
|
|||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
uct.kill();
|
uct.kill();
|
||||||
|
if (pool != null) {
|
||||||
|
Jedis tmpRsc = pool.getResource();
|
||||||
|
try {
|
||||||
|
tmpRsc.set("server:" + serverId + ":playerCount", "0"); // reset
|
||||||
|
for (String i : tmpRsc.smembers("server:" + serverId + ":usersOnline")) {
|
||||||
|
tmpRsc.srem("server:" + serverId + ":usersOnline", i);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
pool.returnResource(tmpRsc);
|
||||||
|
}
|
||||||
|
}
|
||||||
pool.destroy();
|
pool.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user