function rec_transfer_download in Recommender API 6.3
Same name and namespace in other branches
- 7.4 rec_transfer/rec_transfer.module \rec_transfer_download()
- 7.5 rec_transfer/rec_transfer.module \rec_transfer_download()
1 call to rec_transfer_download()
- rec_transfer_handle_commands in rec_transfer/rec_transfer.module
File
- rec_transfer/rec_transfer.module, line 119
- This is the module file for Recommender Data Transfer
Code
function rec_transfer_download($command) {
$command_id = $command['command_id'];
$recommender_id = $command['recommender_id'];
$status_check = rec_transfer_check_service('status', array(
'id' => $command_id,
));
if (!$status_check['success']) {
async_command_update_command($command_id, 0, 'Remote service is not successful running this command. Additional message: ' . $status_check['message'], time());
return;
}
if (isset($status_check['status']) && $status_check['status'] == 'OKOK') {
$s1 = rec_transfer_import_results('similarity', $command_id, $recommender_id);
$s2 = rec_transfer_import_results('prediction', $command_id, $recommender_id);
if ($s1 && $s2) {
async_command_update_command($command_id, 1, 'Command running successful. Message from remote service: ' . $status_check['message'], time());
}
else {
async_command_update_command($command_id, 0, 'Cannot download or import recommendations from remote service. Consider retry.', time());
}
}
}