/**
  * Runs on production when a import status request is received.
  *
  * @param array $args
  * @return string
  */
 public function import_status(array $args)
 {
     $this->xmlrpc_client->handle_request($args);
     $result = $this->xmlrpc_client->get_request_data();
     $batch = $this->batch_dao->find(intval($result['batch_id']));
     $importer = $this->importer_factory->get_importer($batch);
     $importer->status();
     $response = array('status' => $this->api->get_deploy_status($batch->get_id()), 'messages' => $this->api->get_deploy_messages($batch->get_id()));
     $response = apply_filters('sme_import_status_response', $response, $batch);
     // Get status.
     $status = isset($response['status']) ? $response['status'] : 2;
     // Get messages.
     $messages = isset($response['messages']) ? $response['messages'] : array();
     // Prepare and return the XML-RPC response data.
     return $this->xmlrpc_client->prepare_response(array('status' => $status, 'messages' => $messages));
 }