Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/gooddata/lcm/actions/import_object_collections.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def call(params)

client = params.gdc_gd_client
development_client = params.development_client
number_of_threads = Integer(params.number_of_threads || '10')
number_of_threads = Integer(params.number_of_threads || '8')

params.synchronize.peach(number_of_threads) do |info|
from = info.from
Expand Down
2 changes: 1 addition & 1 deletion lib/gooddata/lcm/actions/synchronize_dataset_mappings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def call(params)

client = params.gdc_gd_client
development_client = params.development_client
number_of_threads = Integer(params.number_of_threads || '10')
number_of_threads = Integer(params.number_of_threads || '8')

params.synchronize.peach(number_of_threads) do |info|
from_project = info.from
Expand Down
18 changes: 16 additions & 2 deletions lib/gooddata/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1434,9 +1434,13 @@ def objects_export(objs, options = {})
:crossDataCenterExport => '1'
}
}
result = client.post("#{md['maintenance']}/partialmdexport", export_payload)
export_uri = "/gdc/md/#{pid}/maintenance/partialmdexport"
GoodData.gd_logger.info("Project export action=objects_export, project_id=#{pid}, uri=#{export_uri}, export_status=start, export_objs=#{export_payload}") if GoodData.gd_logger

result = client.post(export_uri, export_payload)
polling_url = result['partialMDArtifact']['status']['uri']
token = result['partialMDArtifact']['token']
GoodData.gd_logger.info("Project export action=objects_export, project_id=#{pid}, uri=#{polling_url}, export_status=polling") if GoodData.gd_logger

polling_result = client.poll_on_response(polling_url, options) do |body|
body['wTaskStatus'] && body['wTaskStatus']['status'] == 'RUNNING'
Expand All @@ -1445,6 +1449,9 @@ def objects_export(objs, options = {})
messages = GoodData::Helpers.interpolate_error_messages(polling_result['wTaskStatus']['messages']).join(' ')
fail ObjectsExportError, "Exporting objects failed with messages. #{messages}"
end

GoodData.gd_logger.info("Project export action=objects_export, project_id=#{pid}, export_status=success") if GoodData.gd_logger

token
end

Expand All @@ -1467,8 +1474,12 @@ def objects_import(token, options = {})
}
}

result = client.post("#{md['maintenance']}/partialmdimport", import_payload)
import_uri = "/gdc/md/#{pid}/maintenance/partialmdimport"
GoodData.gd_logger.info("Project import action=objects_import, project_id=#{pid}, uri=#{import_uri}, import_status=start") if GoodData.gd_logger

result = client.post(import_uri, import_payload)
polling_url = result['uri']
GoodData.gd_logger.info("Project import action=objects_import, project_id=#{pid}, uri=#{polling_url}, import_status=polling") if GoodData.gd_logger

polling_result = client.poll_on_response(polling_url, options) do |body|
body['wTaskStatus'] && body['wTaskStatus']['status'] == 'RUNNING'
Expand All @@ -1478,6 +1489,9 @@ def objects_import(token, options = {})
messages = GoodData::Helpers.interpolate_error_messages(polling_result['wTaskStatus']['messages']).join(' ')
fail ObjectsImportError, "Importing objects failed with messages. #{messages}"
end

GoodData.gd_logger.info("Project import action=objects_import, project_id=#{pid}, uri=#{import_uri}, import_status=success") if GoodData.gd_logger

true
end

Expand Down
Loading