Skip to content

Commit

Permalink
Merge pull request #174 from gwu-libraries/t173-reindex-timeout
Browse files Browse the repository at this point in the history
Patch to avoid timeouts when reindexing
  • Loading branch information
kerchner authored Sep 4, 2018
2 parents 613139d + ceded7f commit 1b39713
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions config/initializers/reindex_request_ntriples.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ActiveFedora::Fedora.class_eval do
def ntriples_connection
authorized_connection.tap { |conn| conn.headers['Accept'] = 'application/n-triples' }
end

def build_ntriples_connection
ActiveFedora::InitializingConnection.new(ActiveFedora::CachingConnection.new(ntriples_connection, omit_ldpr_interaction_model: true), root_resource_path)
end
end

ActiveFedora::Indexing::DescendantFetcher.class_eval do
private

def rdf_resource
@rdf_resource ||= Ldp::Resource::RdfSource.new(ActiveFedora.fedora.build_ntriples_connection, uri)
end
end

0 comments on commit 1b39713

Please sign in to comment.