debian-mirror-gitlab/lib/gitlab/database/async_constraints.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
398 B
Ruby
Raw Normal View History

2023-04-23 21:23:45 +05:30
# frozen_string_literal: true
module Gitlab
module Database
2023-05-27 22:25:52 +05:30
module AsyncConstraints
2023-04-23 21:23:45 +05:30
DEFAULT_ENTRIES_PER_INVOCATION = 2
def self.validate_pending_entries!(how_many: DEFAULT_ENTRIES_PER_INVOCATION)
2023-05-27 22:25:52 +05:30
PostgresAsyncConstraintValidation.ordered.limit(how_many).each do |record|
AsyncConstraints::Validators.for(record).perform
2023-04-23 21:23:45 +05:30
end
end
end
end
end