Class: ImportDatasetImportJob

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

Instance Method Summary collapse

Instance Method Details

#perform(import_dataset, uuid, max_time, max_records) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/jobs/import_dataset_import_job.rb', line 4

def perform(import_dataset, uuid, max_time, max_records)
  begin
    Current.user_id = import_dataset.created_by_id
    Current.project_id = import_dataset.project_id

    import_dataset.with_lock do
       = import_dataset.
      if ['import_uuid'] == uuid
        if import_dataset.import(max_time, max_records).any?
          ImportDatasetImportJob.perform_later(import_dataset, uuid, max_time, max_records)
        end
      end
    end
  rescue => ex
    ExceptionNotifier.notify_exception(ex,
      data: { import_dataset: import_dataset&.id&.to_s }
    )
    raise
  end
end