code: public void waitForLock(T jedis){
          while(!lock(jedis)){
              try {
                  logger.debug("Waiting for Redis lock.");
                  Thread.sleep(randomInt(75, 125));
              } catch (InterruptedException e) {
                  logger.error("Interrupted while waiting for lock.", e);
              }
          }
      }
docs: Attempt to acquire lock. If lock cannot be acquired, wait until lock is successfully acquired.
  @param jedis a thread-safe Redis connection