fix(export/job): race condition when export was already generated

This commit is contained in:
Colin Darie 2023-02-08 18:00:43 +01:00
parent 4b480de9b7
commit 964f3829c6

View file

@ -4,6 +4,8 @@ class ExportJob < ApplicationJob
discard_on ActiveRecord::RecordNotFound discard_on ActiveRecord::RecordNotFound
def perform(export) def perform(export)
return if export.generated?
export.compute_with_safe_stale_for_purge do export.compute_with_safe_stale_for_purge do
export.compute export.compute
end end