From 964f3829c688253418b3fe85da150a0a47320c00 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 8 Feb 2023 18:00:43 +0100 Subject: [PATCH] fix(export/job): race condition when export was already generated --- app/jobs/export_job.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/jobs/export_job.rb b/app/jobs/export_job.rb index bb34695fb..4854c5415 100644 --- a/app/jobs/export_job.rb +++ b/app/jobs/export_job.rb @@ -4,6 +4,8 @@ class ExportJob < ApplicationJob discard_on ActiveRecord::RecordNotFound def perform(export) + return if export.generated? + export.compute_with_safe_stale_for_purge do export.compute end