Skip to content

Commit 87960a5

Browse files
Merge pull request #2038 from gooddata/GRIF-374
GRIF-374: Decrease waiting time for each polling result calling APIs
2 parents 8637321 + 2f7fa78 commit 87960a5

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
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.89
1+
3.7.90

lib/gooddata/lcm/actions/synchronize_clients.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class SynchronizeClients < BaseAction
6161

6262
class << self
6363
def call(params)
64+
GoodData.logger.info 'Starting SynchronizeClients action'
6465
client = params.gdc_gd_client
6566

6667
domain_name = params.organization || params.domain
@@ -91,7 +92,9 @@ def call(params)
9192
segment.master_project = master
9293
segment.save
9394

95+
GoodData.logger.info "Starting synchronize clients for segment: '#{segment.segment_id}' with master workspace: '#{current_master[:master_project_id]}'"
9496
res = segment.synchronize_clients
97+
GoodData.logger.info "Finish synchronize clients for segment: '#{segment.segment_id}'"
9598

9699
sync_result = res.json['synchronizationResult']
97100
failed_count = sync_result['failedClients']['count']

lib/gooddata/rest/client.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Client
2525
# Constants
2626
#################################
2727
DEFAULT_CONNECTION_IMPLEMENTATION = GoodData::Rest::Connection
28-
DEFAULT_SLEEP_INTERVAL = 10
28+
DEFAULT_SLEEP_INTERVAL = 10 # 10 seconds
2929
DEFAULT_POLL_TIME_LIMIT = 5 * 60 * 60 # 5 hours
3030

3131
#################################
@@ -353,6 +353,11 @@ def poll_on_response(link, options = {}, &bl)
353353
end
354354
sleep retry_time
355355
retry_time *= GoodData::Rest::Connection::RETRY_TIME_COEFFICIENT
356+
# Polling response will wait result from calling APIs. So don't need wait a long time for each polling
357+
if retry_time > DEFAULT_SLEEP_INTERVAL
358+
retry_time = DEFAULT_SLEEP_INTERVAL
359+
end
360+
356361
GoodData::Rest::Client.retryable(:tries => Helpers::GD_MAX_RETRY, :refresh_token => proc { connection.refresh_token }) do
357362
response = get(link, process: process)
358363
end

spec/unit/rest/polling_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
before do
7272
GoodData::Rest::Connection::RETRY_TIME_INITIAL_VALUE = 1
7373
GoodData::Rest::Connection::RETRY_TIME_COEFFICIENT = 1.5
74+
GoodData::Rest::Client::DEFAULT_SLEEP_INTERVAL = 10
7475
end
7576

7677
it 'retries after an increasing interval' do

0 commit comments

Comments
 (0)