mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 02:35:57 +02:00
Add que data migration & move CsyncJob to AppilcationJob
This commit is contained in:
parent
7210140de6
commit
83706a78e3
3 changed files with 25 additions and 8 deletions
17
db/data/20210405081552_migrate_que_jobs.rb
Normal file
17
db/data/20210405081552_migrate_que_jobs.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
class MigrateQueJobs < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
QueJob.all.each do |job|
|
||||
next if job.last_error.present?
|
||||
|
||||
klass = job.job_class.constantize
|
||||
next unless klass < ApplicationJob
|
||||
|
||||
args = job.args
|
||||
klass.perform_later(args)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue