Skip to content

Commit 073c4fb

Browse files
fix(lcm): Decrease default thread count using for lcm bricks
1 parent 2d777f1 commit 073c4fb

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.76
1+
3.7.77

lib/gooddata/lcm/actions/import_object_collections.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@ def call(params)
2828

2929
client = params.gdc_gd_client
3030
development_client = params.development_client
31+
number_of_threads = Integer(params.number_of_threads || '10')
3132

32-
params.synchronize.peach do |info|
33+
params.synchronize.peach(number_of_threads) do |info|
3334
from = info.from
3435
to_projects = info.to
3536
transfer_uris = info.transfer_uris
3637

3738
from_project = development_client.projects(from) || fail("Invalid 'from' project specified - '#{from}'")
3839

39-
to_projects.peach do |entry|
40+
to_projects.peach(number_of_threads) do |entry|
4041
pid = entry[:pid]
4142
to_project = client.projects(pid) || fail("Invalid 'to' project specified - '#{pid}'")
4243

lib/gooddata/lcm/actions/synchronize_dataset_mappings.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ def call(params)
4545

4646
client = params.gdc_gd_client
4747
development_client = params.development_client
48+
number_of_threads = Integer(params.number_of_threads || '10')
4849

49-
params.synchronize.peach do |info|
50+
params.synchronize.peach(number_of_threads) do |info|
5051
from_project = info.from
5152
to_projects = info.to
5253

@@ -60,7 +61,7 @@ def call(params)
6061
if dataset_mapping&.dig('datasetMappings', 'items').nil? || dataset_mapping['datasetMappings']['items'].empty?
6162
params.gdc_logger.info "Project: '#{from.title}', PID: '#{from.pid}' has no model mapping, skip synchronizing model mapping."
6263
else
63-
to_projects.peach do |to|
64+
to_projects.peach(number_of_threads) do |to|
6465
pid = to[:pid]
6566
next if sync_failed_project(pid, params)
6667

lib/gooddata/lcm/actions/synchronize_user_filters.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def call(params)
104104
symbolized_config = GoodData::Helpers.symbolize_keys(symbolized_config)
105105
symbolized_config[:labels] = symbolized_config[:labels].map { |l| GoodData::Helpers.symbolize_keys(l) }
106106
multiple_projects_column = params.multiple_projects_column
107+
number_of_threads = Integer(params.number_of_threads || '10')
107108

108109
mode = params.sync_mode
109110
unless MODES.include?(mode)
@@ -196,7 +197,7 @@ def call(params)
196197

197198
unless run_params[:do_not_touch_filters_that_are_not_mentioned]
198199
to_be_deleted_clients = UserBricksHelper.non_working_clients(domain_clients, working_client_ids)
199-
to_be_deleted_clients.peach do |c|
200+
to_be_deleted_clients.peach(number_of_threads) do |c|
200201
begin
201202
current_project = c.project
202203
users = users_by_project[c.client_id]

lib/gooddata/lcm/lcm2.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ def print_actions_result(actions, results)
295295
end
296296

297297
def perform(mode, params = {})
298+
# Default setting for $pmap_default_thread_count = 20 in gooddata.rb file. We are going to decrease default
299+
# number of threads count to 10 for LCM bricks only
300+
$pmap_default_thread_count = 10 # rubocop:disable GlobalVars
301+
298302
params = convert_params(params)
299303

300304
GoodData.gd_logger.brick = mode

0 commit comments

Comments
 (0)