Skip to content

Commit

Permalink
Up the default OAI request timeout from 60sec to 10min
Browse files Browse the repository at this point in the history
  • Loading branch information
payten authored and marktriggs committed Jul 20, 2017
1 parent 04ed71c commit 96f1a8d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions oai/app/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@

class ArchivesSpaceOAIServer < Sinatra::Base

TIMEOUT = 600

get "/favicon.ico" do
status 404
end

get '/sample' do
oai_sample_url = URI.join(AppConfig[:backend_url], 'oai_sample')

ASHTTP.start_uri(oai_sample_url) do |http|
ASHTTP.start_uri(oai_sample_url, :open_timeout => TIMEOUT, :read_timeout => TIMEOUT) do |http|
http_request = Net::HTTP::Get.new(oai_sample_url.request_uri)
response = http.request(http_request)

Expand All @@ -39,7 +41,7 @@ def send_get(query_string)
oai_url = build_oai_url
oai_url.query = query_string

ASHTTP.start_uri(oai_url) do |http|
ASHTTP.start_uri(oai_url, :open_timeout => TIMEOUT, :read_timeout => TIMEOUT) do |http|
http_request = Net::HTTP::Get.new(oai_url.request_uri)
response = http.request(http_request)

Expand Down

0 comments on commit 96f1a8d

Please sign in to comment.