lib/httpx/resolver/native.rb in httpx-0.20.1 vs lib/httpx/resolver/native.rb in httpx-0.20.2

- old
+ new

@@ -116,10 +116,14 @@ @start_timeout = Utils.now hosts = @queries.keys @timeouts.values_at(*hosts).reject(&:empty?).map(&:first).min end + def raise_timeout_error(interval) + do_retry(interval) + end + private def calculate_interests return :w unless @write_buffer.empty? @@ -132,13 +136,13 @@ dread if calculate_interests == :r do_retry dwrite if calculate_interests == :w end - def do_retry + def do_retry(loop_time = nil) return if @queries.empty? || !@start_timeout - loop_time = Utils.elapsed_time(@start_timeout) + loop_time ||= Utils.elapsed_time(@start_timeout) query = @queries.first return unless query