Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HYC-1868 - Prevent timeout when ingesting large files #1075

Merged
merged 4 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions app/overrides/lib/active-fedora/fedora_override.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true
# https://github.com/samvera/active_fedora/blob/v14.0.1/lib/active_fedora/fedora.rb
ActiveFedora::Fedora.class_eval do
def authorized_connection
options = {}
options[:ssl] = ssl_options if ssl_options
options[:request] = request_options if request_options
Faraday.new(host, options) do |conn|
conn.response :encoding # use Faraday::Encoding middleware
conn.adapter Faraday.default_adapter # net/http
# [hyc-override] Setting timeout to 5 minutes to allow for deposit of large files (default: 60)
conn.options.timeout = 60 * 5
if Gem::Version.new(Faraday::VERSION) < Gem::Version.new('2')
conn.request :basic_auth, user, password
else
conn.request :authorization, :basic, user, password
end
end
end
end
3 changes: 3 additions & 0 deletions config/fedora.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
default: &default
request:
timeout: 300
development:
user: fedoraAdmin
password: fedoraAdmin
Expand Down
Loading