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
1 changed files with 8 additions and 1 deletions

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;
}
}