Merge pull request #5623 from Keirua/use-after_save_commit-for-async-tasks

create export after commiting the export object
This commit is contained in:
Keirua 2020-09-24 23:21:21 +02:00 committed by GitHub
commit c5af4110a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)