Skip to content

Commit

Permalink
increase timeouts for some handle server calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 5, 2019
1 parent 262ee44 commit 9b91260
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/concerns/helpable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def get_dois(options={})
return OpenStruct.new(body: { "errors" => [{ "title" => "Prefix missing" }] }) unless options[:prefix].present?

count_url = "#{ENV['HANDLE_URL']}/api/handles?prefix=#{options[:prefix]}&pageSize=0"
response = Maremma.get(count_url, username: "300%3A#{ENV['HANDLE_USERNAME']}", password: ENV['HANDLE_PASSWORD'], ssl_self_signed: true, timeout: 10)
response = Maremma.get(count_url, username: "300%3A#{ENV['HANDLE_USERNAME']}", password: ENV['HANDLE_PASSWORD'], ssl_self_signed: true, timeout: 60)

total = response.body.dig("data", "totalCount").to_i
dois = []
Expand All @@ -121,7 +121,7 @@ def get_dois(options={})

(0...total_pages).each do |page|
url = "#{ENV['HANDLE_URL']}/api/handles?prefix=#{options[:prefix]}&page=#{page}&pageSize=1000"
response = Maremma.get(url, username: "300%3A#{ENV['HANDLE_USERNAME']}", password: ENV['HANDLE_PASSWORD'], ssl_self_signed: true, timeout: 10)
response = Maremma.get(url, username: "300%3A#{ENV['HANDLE_USERNAME']}", password: ENV['HANDLE_PASSWORD'], ssl_self_signed: true, timeout: 60)
if response.status == 200
dois += (response.body.dig("data", "handles") || [])
else
Expand Down

0 comments on commit 9b91260

Please sign in to comment.