Skip to content
代码片段 群组 项目
提交 a71ec1a7 编辑于 作者: Adam Hegyi's avatar Adam Hegyi
浏览文件

Merge branch 'service-each-batch' into 'master'

Use each_batch instead of in_batches

See merge request gitlab-org/gitlab!45934
加载中
......@@ -8,6 +8,7 @@ class Service < ApplicationRecord
include ProjectServicesLoggable
include DataFields
include FromUnion
include EachBatch
SERVICE_NAMES = %w[
alerts asana assembla bamboo bugzilla buildkite campfire confluence custom_issue_tracker discord
......@@ -294,7 +295,7 @@ def category
end
def initialize_properties
self.properties = {} if properties.nil?
self.properties = {} if has_attribute?(:properties) && properties.nil?
end
def title
......
......@@ -20,7 +20,7 @@ def propagate
# rubocop: disable Cop/InBatches
def update_inherited_integrations
Service.by_type(integration.type).inherit_from_id(integration.id).in_batches(of: BATCH_SIZE) do |services|
Service.by_type(integration.type).inherit_from_id(integration.id).each_batch(of: BATCH_SIZE) do |services|
min_id, max_id = services.pick("MIN(services.id), MAX(services.id)")
PropagateIntegrationInheritWorker.perform_async(integration.id, min_id, max_id)
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册