Exemple #1
0
 /**
  * Remove all outstanding requests for selected keyword groups
  * @return json
  * @author Ruslan Ushakov
  */
 function cron_job_clear_requests()
 {
     $this->load->model('ranking_model');
     $job_ids = $this->input->post('job_ids');
     if (!empty($job_ids)) {
         $cron_jobs = $this->ranking_model->getCronJobsById($job_ids);
         $group_ids = array();
         foreach ($cron_jobs as $job) {
             if (!empty($job->group_id) && !in_array($job->group_id, $group_ids)) {
                 $group_ids[] = (int) $job->group_id;
             }
         }
         $this->ranking_model->deleteOutstandingRequests($group_ids);
     }
     $this->output->set_content_type('application/json')->set_output(json_encode(array('status' => 'ok')));
 }