Permalink
Browse files

add delay to hipotrip

  • Loading branch information...
sizief committed Sep 12, 2018
1 parent ce3f7a3 commit d46742afd46f32670b50ecaa12208216d76b1c11
Showing with 4 additions and 3 deletions.
  1. +4 −3 app/models/suppliers/hipotrip.rb
@@ -45,8 +45,9 @@ def search_supplier
if Rails.env.test?
response = mock_results
else
sleep results["estimated_delay_time"].to_f
response = RestClient::Request.execute(method: :get,
delay = results["estimated_delay_time"].to_f == 0 ? 5 : results["estimated_delay_time"].to_f
sleep delay
response = RestClient::Request.execute(method: :get,
url: "#{URI.parse(url)}",
proxy: nil)
response = response.body
@@ -163,4 +164,4 @@ def flight_number_correction(flight_number,airline_code)
return flight_number.gsub(/[^\d,\.]/, '')
end
end
end

0 comments on commit d46742a

Please sign in to comment.