Skip to content

Commit

Permalink
Moving OAI metadata capture to entry processing (#697)
Browse files Browse the repository at this point in the history
In writing #694 I introduced an OAI bug.  There are two OAI fetch
cycles.

The first is the list of records.  These are fetched via the
`list_identifiers` method.  That method returns header information
without metadata.  Then, we submit one job per header.  At that point we
perform the second fetch of the record.  This includes the full
metadata.
  • Loading branch information
jeremyf authored Dec 22, 2022
1 parent d1d0eca commit b857a25
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions app/models/bulkrax/oai_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def thumbnail_url
def build_metadata
self.parsed_metadata = {}
self.parsed_metadata[work_identifier] = [record.header.identifier]
self.raw_metadata = { xml: record.metadata.to_s }

record.metadata.children.each do |child|
child.children.each do |node|
Expand Down
1 change: 0 additions & 1 deletion app/parsers/bulkrax/oai_dc_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def create_works
break if limit_reached?(limit, index)
seen[identifier] = true
new_entry = entry_class.where(importerexporter: self.importerexporter, identifier: identifier).first_or_create!
new_entry.update!(raw_metadata: { xml: record.metadata.to_s })
if record.deleted?
DeleteWorkJob.send(perform_method, new_entry, importerexporter.current_run)
else
Expand Down

0 comments on commit b857a25

Please sign in to comment.