lib/yt/request.rb
def sleep_and_retry?(max_retries = 1)
      @retries_so_far ||= -1
      @retries_so_far += 1
      if (@retries_so_far < max_retries)
        @response = @http_request = @uri = nil
        sleep retry_time
      end
    end
# Sleeps for a while and returns true for the first +max_retries+ times,
# then returns false. Useful to try the same request again multiple
# times with a delay if a connection error occurs.
Sleeps for a while and returns true for the first +max_retries+ times,
then returns false. Useful to try the same request again multiple
times with a delay if a connection error occurs.
Sleeps for a while and returns true for the first + max_retries + times then returns false . Useful to try the same request again multiple times with a delay if a connection error occurs .
def sleep_and_retry?(max_retries = 1)
      @retries_so_far ||= -1
      @retries_so_far += 1
      if (@retries_so_far < max_retries)
        @response = @http_request = @uri = nil
        sleep retry_time
      end
    end
def sleep_and_retry? ( max_retries = 1 ) @retries_so_far ||= - 1 @retries_so_far += 1 if ( @retries_so_far < max_retries ) @response = @http_request = @uri = nil sleep retry_time end end
Sleeps for a while and returns true for the first +max_retries+ times,
then returns false.
Sleeps for a while and returns true for the first + max_retries + times then returns false .
max_retries