Commit 6a038925 authored by Steve Abrams's avatar Steve Abrams

Merge branch '292239-schedule-duplicate-findings-removal' into 'master'

Schedule removal of duplicate Findings

See merge request gitlab-org/gitlab!55749
parents 478d0dcc 6db73123
---
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