public static boolean reconnect ( final Jedis jedis , final int reconAttempts , final long reconnectSleepTime ) { int i = 1 ; do { try { jedis . disconnect ( ) ; try { Thread . sleep ( reconnectSleepTime ) ; } catch ( Exception e2 ) { } jedis . connect ( ) ; } catch ( JedisConnectionException jce ) { } // Ignore bad connection attempts catch ( Exception e3 ) { LOG . error ( "Unknown Exception while trying to reconnect to Redis" , e3 ) ; } } while ( ++ i <= reconAttempts && ! testJedisConnection ( jedis ) ) ; return testJedisConnection ( jedis ) ; }
Attempt to reconnect to Redis .