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);
    }
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 ) { } 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.

@param jedis
the connection to Redis
@param reconAttempts
number of times to attempt to reconnect before giving up
@param reconnectSleepTime
time in milliseconds to wait between attempts
@return true if reconnection was successful