mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 16:32:04 +02:00
Move DomainUpdateConfirm from Que to ActiveJob
This commit is contained in:
parent
42b9adbf44
commit
31bfe19d77
4 changed files with 12 additions and 9 deletions
2
app/jobs/application_job.rb
Normal file
2
app/jobs/application_job.rb
Normal file
|
@ -0,0 +1,2 @@
|
|||
class ApplicationJob < ActiveJob::Base
|
||||
end
|
|
@ -1,5 +1,7 @@
|
|||
class DomainUpdateConfirmJob < Que::Job
|
||||
def run(domain_id, action, initiator = nil)
|
||||
class DomainUpdateConfirmJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(domain_id, action, initiator = nil)
|
||||
::PaperTrail.request.whodunnit = "job - #{self.class.name} - #{action} by #{initiator}"
|
||||
# it's recommended to keep transaction against job table as short as possible.
|
||||
ActiveRecord::Base.transaction do
|
||||
|
@ -27,7 +29,6 @@ class DomainUpdateConfirmJob < Que::Job
|
|||
domain.preclean_pendings
|
||||
domain.clean_pendings!
|
||||
end
|
||||
destroy # it's best to destroy the job in the same transaction
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue