Skip to content

Commit 3fddc88

Browse files
Merge pull request #2051 from gooddata/GRIF-465
GRIF-465: Allow configure number of threads using for migration dates
2 parents ad91bb5 + 3b556a0 commit 3fddc88

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.95
1+
3.7.96

lib/gooddata/lcm/actions/migrate_gdc_date_dimension.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ class MigrateGdcDateDimension < BaseAction
3131

3232
description 'Sync failed list'
3333
param :sync_failed_list, instance_of(Type::HashType), required: false
34+
35+
description 'Number Of Threads'
36+
param :number_of_threads_migrate_dates, instance_of(Type::StringType), required: false, default: '10'
3437
end
3538

3639
RESULT_HEADER = %i[from to status]
@@ -53,6 +56,8 @@ def call(params)
5356
def migrate_date_dimension(params, segment_info)
5457
results = []
5558
client = params.gdc_gd_client
59+
number_of_threads = Integer(params.number_of_threads_migrate_dates || '10')
60+
GoodData.logger.info "Number of threads using migration dates #{number_of_threads}"
5661
latest_blueprint = segment_info[:from_blueprint]
5762
# don't migrate when latest master doesn't contain custom v2 date.
5863
return results unless contain_v2?(latest_blueprint)
@@ -64,7 +69,7 @@ def migrate_date_dimension(params, segment_info)
6469
collect_synced_status = collect_synced_status(params)
6570
failed_projects = ThreadSafe::Array.new
6671

67-
segment_info[:to].pmap do |entry|
72+
segment_info[:to].pmap(number_of_threads) do |entry|
6873
pid = entry[:pid]
6974
next if sync_failed_project(pid, params)
7075

0 commit comments

Comments
 (0)