6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/jobs/export_job.rb', line 6
def perform(execution_id)
execution = MigrationExecution.find(execution_id)
migration_plan = execution.migration_plan
Exports::GeneratorService.new(migration_plan, execution).call
rescue StandardError => e
Rails.logger.error("ExportJob 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
|