Skip to content

Commit dd71048

Browse files
Merge pull request #2054 from gooddata/GRIF-494
GRIF-494: Allow configure number of threads using for synchronize ldm
2 parents e9045e2 + 2dad841 commit dd71048

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.97
1+
3.7.98

lib/gooddata/lcm/actions/synchronize_ldm.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class SynchronizeLdm < BaseAction
5757

5858
description 'Sync failed list'
5959
param :sync_failed_list, instance_of(Type::HashType), required: false
60+
61+
description 'Number Of Threads'
62+
param :number_of_threads_synchronize_ldm, instance_of(Type::StringType), required: false, default: '10'
6063
end
6164

6265
RESULT_HEADER = %i[from to status]
@@ -91,6 +94,9 @@ def sync_segment_ldm(params, segment_info)
9194
exclude_fact_rule = params.exclude_fact_rule.to_b
9295
include_deprecated = params.include_deprecated.to_b
9396
update_preference = params[:update_preference]
97+
number_of_threads = Integer(params.number_of_threads_synchronize_ldm || '10')
98+
GoodData.logger.info "Number of threads using synchronize logical data model #{number_of_threads}"
99+
94100
exist_fallback_to_hard_sync_config = !update_preference.nil? && !update_preference[:fallback_to_hard_sync].nil?
95101
include_maql_fallback_hard_sync = exist_fallback_to_hard_sync_config && Helpers.to_bool('fallback_to_hard_sync', update_preference[:fallback_to_hard_sync])
96102

@@ -141,7 +147,7 @@ def sync_segment_ldm(params, segment_info)
141147
end
142148
end
143149

144-
segment_info[:to] = segment_info[:to].pmap do |entry|
150+
segment_info[:to] = segment_info[:to].pmap(number_of_threads) do |entry|
145151
update_status = true
146152
pid = entry[:pid]
147153
next if sync_failed_project(pid, params)

0 commit comments

Comments
 (0)