Commit 6db73123 authored by Michał Zając's avatar Michał Zając Committed by Steve Abrams

Schedule removal of duplicate Findings

parent 14addedb
---
title: Schedule removal of duplicate Findings
merge_request: 55749
author:
type: other
# frozen_string_literal: true
class ScheduleRemoveDuplicateVulnerabilitiesFindings2 < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
MIGRATION = 'RemoveDuplicateVulnerabilitiesFindings'
DELAY_INTERVAL = 2.minutes.to_i
BATCH_SIZE = 5_000
disable_ddl_transaction!
class VulnerabilitiesFinding < ActiveRecord::Base
include ::EachBatch
self.table_name = "vulnerability_occurrences"
end
def up
say "Scheduling #{MIGRATION} jobs"
queue_background_migration_jobs_by_range_at_intervals(
VulnerabilitiesFinding,
MIGRATION,
DELAY_INTERVAL,
batch_size: BATCH_SIZE
)
end
def down
# no-op
end
end
a6bf41632fc3d81d2c015d2d848f4e74468ec8cfeb2a2afb644fd92189e95e21
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment