demarches-normaliennes/app/jobs/export_job.rb

22 lines
382 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
2019-12-03 18:36:50 +01:00
class ExportJob < ApplicationJob
2020-09-22 17:14:31 +02:00
queue_as :exports
2021-10-04 12:57:37 +02:00
discard_on ActiveRecord::RecordNotFound
def max_run_time
Export::MAX_DUREE_GENERATION
end
2019-12-03 18:36:50 +01:00
def perform(export)
return if export.generated?
Sentry.set_tags(procedure: export.procedure.id)
export.compute_with_safe_stale_for_purge do
export.compute
end
2019-12-03 18:36:50 +01:00
end
end