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
|