diff --git a/app/models/iiif_image.rb b/app/models/iiif_image.rb index 372623a9..425944a3 100644 --- a/app/models/iiif_image.rb +++ b/app/models/iiif_image.rb @@ -19,7 +19,7 @@ def initialize(stacks_file:, transformation:, base_uri: Settings.imageserver.bas def response with_retries max_tries: 3, rescue: [HTTP::ConnectionError] do benchmark "Fetch #{image_url}" do - HTTP.timeout(connect: 15) + HTTP.timeout(connect: 15, read_timeout: 5.minutes) .headers(user_agent: "#{HTTP::Request::USER_AGENT} (#{Settings.user_agent})") .use({ normalize_uri: { normalizer: lambda(&:itself) } }) .get(image_url) diff --git a/app/services/iiif_metadata_service.rb b/app/services/iiif_metadata_service.rb index cfe18211..4f6cb2c0 100644 --- a/app/services/iiif_metadata_service.rb +++ b/app/services/iiif_metadata_service.rb @@ -47,7 +47,7 @@ def retrieve handle_response( # Disable url normalization as an upstream bug in addressable causes issues for `+` # https://github.com/sporkmonger/addressable/issues/386 - HTTP.timeout(connect: 15) + HTTP.timeout(connect: 15, read_timeout: 5.minutes) .headers(user_agent: "#{HTTP::Request::USER_AGENT} (#{Settings.user_agent})") .use({ normalize_uri: { normalizer: lambda(&:itself) } }).get(@url) )