mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-12-23 10:38: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
|
||||
public void onDisable() {
|
||||
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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user