mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
25 lines
644 B
Ruby
25 lines
644 B
Ruby
class MigrateQueJobs < ActiveRecord::Migration[6.0]
|
|
def up
|
|
# QueJob.all.each do |job|
|
|
# if skip_condition(job)
|
|
# logger.info "Skipped Que job migration: #{job.inspect}"
|
|
# else
|
|
# args = job.args
|
|
#
|
|
# job.job_class.constantize.set(wait_until: job.run_at).perform_later(args)
|
|
# end
|
|
# end
|
|
end
|
|
|
|
def down
|
|
# raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
|
|
# def logger
|
|
# @logger ||= Logger.new(Rails.root.join('log', 'que_to_sidekiq_migration.log'))
|
|
# end
|
|
#
|
|
# def skip_condition(job)
|
|
# job.last_error.present? || !(job.job_class.constantize < ApplicationJob)
|
|
# end
|
|
end
|