2020-10-15 03:08:35 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class DropBackfillJiraTrackerDeploymentTypeJobs < ActiveRecord::Migration[6.0]
|
|
|
|
DOWNTIME = false
|
2021-01-08 18:10:43 +00:00
|
|
|
DROPPED_JOB_CLASS = 'BackfillJiraTrackerDeploymentType'
|
|
|
|
QUEUE = 'background_migration'
|
2020-10-15 03:08:35 +00:00
|
|
|
|
|
|
|
def up
|
|
|
|
sidekiq_queues.each do |queue|
|
|
|
|
queue.each do |job|
|
|
|
|
next unless job.args.first == DROPPED_JOB_CLASS
|
|
|
|
|
|
|
|
job.delete
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
# no-op
|
|
|
|
end
|
|
|
|
|
|
|
|
def sidekiq_queues
|
|
|
|
[Sidekiq::ScheduledSet.new, Sidekiq::RetrySet.new, Sidekiq::Queue.new(QUEUE)]
|
|
|
|
end
|
|
|
|
end
|