Class: Bulkrax::ImportWorkCollectionJob
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- Bulkrax::ImportWorkCollectionJob
- Defined in:
- app/jobs/bulkrax/import_work_collection_job.rb
Instance Method Summary collapse
-
#perform(*args) ⇒ Object
rubocop:disable Rails/SkipsModelValidations.
Instance Method Details
#perform(*args) ⇒ Object
rubocop:disable Rails/SkipsModelValidations
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/jobs/bulkrax/import_work_collection_job.rb', line 8 def perform(*args) entry = Entry.find(args[0]) begin entry.build entry.save (entry) ImporterRun.find(args[1]).increment!(:processed_collections) ImporterRun.find(args[1]).decrement!(:enqueued_records) rescue => e ImporterRun.find(args[1]).increment!(:failed_collections) ImporterRun.find(args[1]).decrement!(:enqueued_records) raise e end end |