2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-22 20:28:00 +00:00

fix automatic reconnect in case of network issues

This commit is contained in:
Moehritz 2016-03-11 02:19:40 +01:00
parent 4980ec6a0d
commit b71dbd8283

View File

@ -519,7 +519,14 @@ public final class RedisBungee extends Plugin {
// FIXME: Extremely ugly hack
// Attempt to unsubscribe this instance and try again.
getLogger().log(Level.INFO, "PubSub error, attempting to recover.", e);
jpsh.unsubscribe();
try {
jpsh.unsubscribe();
} catch (Exception e1) {
/* This may fail with
- java.net.SocketException: Broken pipe
- redis.clients.jedis.exceptions.JedisConnectionException: JedisPubSub was not subscribed to a Jedis instance
*/
}
broken = true;
}
}