demarches-normaliennes/app/jobs/export_job.rb
2023-02-09 11:06:54 +01:00

17 lines
340 B
Ruby

class ExportJob < ApplicationJob
queue_as :exports
discard_on ActiveRecord::RecordNotFound
before_perform do |job|
Sentry.set_tags(procedure_id: job.arguments.first.procedure.id)
end
def perform(export)
return if export.generated?
export.compute_with_safe_stale_for_purge do
export.compute
end
end
end