Skip to content

Commit bb89594

Browse files
Merge pull request #2040 from gooddata/GRIF-397
GRIF-397: Allow configure timeout during calling synchronize clients
2 parents 84705ca + 8a56237 commit bb89594

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

.gdc-ii-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ microservices:
44
dockerfile: './DockerfileOldImage'
55
# specifies whether promote image to M3 image tag when release LCM. Default always promote image. Don't remote
66
# image when promoteImage configure false
7-
promoteImage: false
7+
promoteImage: true
88
# specifies whether run register pipeline components for the image when promote image. Default always run register
99
# pipeline components. Don't run register when registerPipelineComponentsWhenPromote configure false
10-
registerPipelineComponentsWhenPromote: false
10+
registerPipelineComponentsWhenPromote: true
1111
argumentsFromFiles:
1212
BRICKS_VERSION: 'VERSION'
1313
lcm-bricks-nextversion:
1414
docker:
1515
dockerfile: './Dockerfile'
1616
# specifies whether promote image to M3 image tag when release LCM. Default always promote image. Don't remote
1717
# image when promoteImage configure false
18-
promoteImage: true
18+
promoteImage: false
1919
# specifies whether run register pipeline components for the image when promote image. Default always run register
2020
# pipeline components. Don't run register when registerPipelineComponentsWhenPromote configure false
2121
registerPipelineComponentsWhenPromote: false

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.91
1+
3.7.92

lib/gooddata/lcm/actions/synchronize_clients.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ class SynchronizeClients < BaseAction
5050

5151
description 'Sync failed list'
5252
param :sync_failed_list, instance_of(Type::HashType), required: false
53+
54+
description 'Synchronize clients time limit'
55+
param :sync_clients_timeout, instance_of(Type::StringType), required: false
5356
end
5457

5558
RESULT_HEADER = [
@@ -70,6 +73,8 @@ def call(params)
7073
data_product = params.data_product
7174
domain_segments = domain.segments(:all, data_product)
7275
keep_only_previous_masters_count = Integer(params.keep_only_previous_masters_count || "-1")
76+
sync_clients_options = {}
77+
sync_clients_options = sync_clients_options.merge(:time_limit => Integer(params.sync_clients_timeout)) if params.sync_clients_timeout
7378

7479
segments = params.segments.map do |seg|
7580
domain_segments.find do |s|
@@ -93,7 +98,7 @@ def call(params)
9398
segment.save
9499

95100
GoodData.logger.info "Starting synchronize clients for segment: '#{segment.segment_id}' with master workspace: '#{current_master[:master_project_id]}'"
96-
res = segment.synchronize_clients
101+
res = segment.synchronize_clients(sync_clients_options)
97102
GoodData.logger.info "Finish synchronize clients for segment: '#{segment.segment_id}'"
98103

99104
sync_result = res.json['synchronizationResult']

lib/gooddata/models/segment.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,14 @@ def save
193193

194194
# Runs async process that walks through segments and provisions projects if necessary.
195195
#
196+
# @param options [Hash] Options
196197
# @return [Array] Returns array of results
197-
def synchronize_clients
198+
def synchronize_clients(options = {})
198199
sync_uri = SYNCHRONIZE_URI % [domain.obj_id, data_product.data_product_id, id]
199200
res = client.post sync_uri, nil
200201

201202
# wait until the instance is created
202-
res = client.poll_on_response(res['asyncTask']['links']['poll'], :sleep_interval => 1) do |r|
203+
res = client.poll_on_response(res['asyncTask']['links']['poll'], options.merge(:sleep_interval => 1)) do |r|
203204
r['synchronizationResult'].nil?
204205
end
205206

0 commit comments

Comments
 (0)