6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'app/jobs/import_job.rb', line 6
def perform(execution_id)
execution = MigrationExecution.find(execution_id)
migration_plan = execution.migration_plan
uploaded_file_path = execution.file_path
Imports::ProcessorService.new(migration_plan, execution, uploaded_file_path).call
rescue StandardError => e
Rails.logger.error("ImportJob failed for execution #{execution_id}: #{e.message}")
Rails.logger.error(e.backtrace.join("\n"))
if execution.reload.status != 'failed'
execution.update!(
status: :failed,
completed_at: Time.current,
error_log: e.full_message
)
end
end
|