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:
commit
c5af4110a4
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue