diff --git a/app/jobs/export_job.rb b/app/jobs/export_job.rb index bb34695fb..3884f97d7 100644 --- a/app/jobs/export_job.rb +++ b/app/jobs/export_job.rb @@ -3,7 +3,13 @@ class ExportJob < ApplicationJob 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 diff --git a/app/models/export.rb b/app/models/export.rb index 4f21b176d..fa8c6910e 100644 --- a/app/models/export.rb +++ b/app/models/export.rb @@ -163,6 +163,10 @@ class Export < ApplicationRecord end end + def procedure + groupe_instructeurs.first.procedure + end + private def load_snapshot! @@ -204,8 +208,4 @@ class Export < ApplicationRecord service.to_geo_json end end - - def procedure - groupe_instructeurs.first.procedure - end end