Update Using Bulkrax CRC1280 Folder Parser to do Imports authored by Johannes Frenzel's avatar Johannes Frenzel
......@@ -130,3 +130,34 @@ The csv files are stored at `rdms/hyrax/tmp/imports/`, where `rdms` is the root
When a new CRCDataset is imported with the same collection name as an existing CRC1280 collection (either previously imported or created by a user), it will create a new collection, rather than reuse the one previously created.
When a new CRCDataset is imported again (it was previously imported), it will create a new collection and a new experiment, rather than reuse the ones previously created.
### Troubleshooting
#### reschedule pending jobs from the console
```ruby
importer = ::Bulkrax::Importer.find(importer_id)
# Needed only if the relationship job is missing.
# Adding it will do not harm.
# The job will run and n ot do anything if the relationships have finished.
::Bulkrax::ScheduleRelationshipsJob.set(wait: 5.minutes).perform_later(importer_id: importer.id)
importer.status_info('Pending')
importer.entries.each do |entry|
next if entry.status == 'Complete'
type = if entry.raw_metadata['model'] == 'CrcDataset'
'Work'
else
entry.raw_metadata['model']
end
entry.status_info('Pending')
"Bulkrax::CrcDataset::Import#{type}Job".constantize.send(
entry.parser.perform_method,
entry.id,
importer.importer_runs.last.id
)
end
```
\ No newline at end of file