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

Merge pull request #36 from Moehritz/fix

fix automatic pubsub reconnect in case of network issues
This commit is contained in:
Tux 2016-03-10 22:03:14 -05:00
commit 3a1362fd7a

View File

@ -518,7 +518,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;
}
}