code: private void onCleanup(Object connection)
      {
          // if not running within transaction boundary
          if (this.connection != null)
          {
              if (settings != null)
              {
                  ((Jedis) connection).configResetStat();
              }
              factory.releaseConnection((Jedis) this.connection);
          }
  
          this.connection = null;
      }
docs: On release connection.
  
  @param connection
  redis connection instance.