@@ -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