canvas-lms/db/migrate/20230810205015_remove_pendi...

31 lines
1.1 KiB
Ruby

# frozen_string_literal: true
#
# Copyright (C) 2023 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
class RemovePendingCoursePacingJobs < ActiveRecord::Migration[7.0]
tag :postdeploy
disable_ddl_transaction!
def up
Progress.find_ids_in_ranges(batch_size: 50_000) do |start_id, end_id|
DataFixup::RemovePendingCoursePacingJobs.delay_if_production(
priority: Delayed::LOWER_PRIORITY,
n_strand: ["remove_pending_course_pacing_jobs", Shard.current.database_server.id]
).run(start_id, end_id)
end
end
end