def call(params)
results = []
client = params.gdc_gd_client
development_client = params.development_client
number_of_threads = Integer(params.number_of_threads || '8')
params.synchronize.peach(number_of_threads) do |info|
from = info.from
to_projects = info.to
transfer_uris = info.transfer_uris
from_project = development_client.projects(from) || fail("Invalid 'from' project specified - '#{from}'")
to_projects.peach(number_of_threads) do |entry|
pid = entry[:pid]
to_project = client.projects(pid) || fail("Invalid 'to' project specified - '#{pid}'")
if transfer_uris.any?
from_project.partial_md_export(transfer_uris, project: to_project)
end
results << {
from: from,
to: pid,
status: 'ok'
}
end
end
results
end