From d617a4b2529f319ae54fa2d118d7baabce11a7f0 Mon Sep 17 00:00:00 2001 From: clemkeirua Date: Thu, 24 Sep 2020 17:39:16 +0200 Subject: [PATCH] create export after commiting the export object --- app/models/export.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/export.rb b/app/models/export.rb index 39f9e107b..508c63792 100644 --- a/app/models/export.rb +++ b/app/models/export.rb @@ -24,7 +24,7 @@ class Export < ApplicationRecord scope :stale, -> { where('updated_at < ?', (Time.zone.now - MAX_DUREE_CONSERVATION_EXPORT)) } - after_create :compute_async + after_save_commit :compute_async def compute_async ExportJob.perform_later(self)