Welcome to mirror list, hosted at ThFree Co, Russian Federation.

async_foreign_keys.rb « database « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 115ae9ba2e8ac441d4ba715f8de4a807ddba68aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

module Gitlab
  module Database
    module AsyncForeignKeys
      DEFAULT_ENTRIES_PER_INVOCATION = 2

      def self.validate_pending_entries!(how_many: DEFAULT_ENTRIES_PER_INVOCATION)
        PostgresAsyncForeignKeyValidation.ordered.limit(how_many).each do |record|
          ForeignKeyValidator.new(record).perform
        end
      end
    end
  end
end