Class: Bulkrax::DeleteAndImportJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/bulkrax/delete_and_import_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(entry, importer_run) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/jobs/bulkrax/delete_and_import_job.rb', line 7

def perform(entry, importer_run)
  status = self.class::DELETE_CLASS.perform_now(entry, importer_run)
  if status.status_message == "Deleted"
    entry = Bulkrax::Entry.find(entry.id) # maximum reload
    self.class::IMPORT_CLASS.perform_now(entry.id, importer_run.id)
  end

rescue => e
  entry.set_status_info(e)
  # this causes caught exception to be reraised
  raise
end