From dd5b2ee407786e21ebda1d51ec6dabc8f3d90295 Mon Sep 17 00:00:00 2001 From: Hung Nguyen Date: Wed, 21 Aug 2024 16:57:23 +0700 Subject: [PATCH] STL-744: Add error relate to synchronize translation to execution log --- VERSION | 2 +- lib/gooddata/lcm/actions/synchronize_clients.rb | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index ad70aa422..1d8ffbdf5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.7.68 +3.7.69 diff --git a/lib/gooddata/lcm/actions/synchronize_clients.rb b/lib/gooddata/lcm/actions/synchronize_clients.rb index 70246f9a8..432906c71 100644 --- a/lib/gooddata/lcm/actions/synchronize_clients.rb +++ b/lib/gooddata/lcm/actions/synchronize_clients.rb @@ -170,7 +170,17 @@ def error_handle(segment, error_result, continue_on_error, params) # Synchronize failure for all clients in segment if continue_on_error && success_count.zero? && failed_count.positive? - segment_warning_message = "Failed to synchronize clients for #{segment.segment_id} segment. Details: #{sync_result['links']['details']}" + segment_warning_message = "Failed to synchronize all clients for #{segment.segment_id} segment. Details: #{sync_result['links']['details']}" + if error_result.details # rubocop:disable Style/SafeNavigation + error_count = 1 + error_result.details.items.each do |item| + break if error_count > 5 + + GoodData.logger.warn("Synchronize failure for '#{item['id']}' client. Error: #{error_message(item, segment)}") unless item['status'] == 'OK' + error_count += 1 + end + end + add_failed_segment(segment.segment_id, segment_warning_message, short_name, params) return end