function tripal_execute_job

2.x tripal_execute_job($job_id, $redirect = TRUE)

Execute a specific Tripal Job.


$job_id: The job id to be exeuted

bool $redirect [optional]: Whether to redirect to the job page or not

1 string reference to 'tripal_execute_job'
tripal_core_menu in tripal_core/tripal_core.module
Implements hook_menu(). Defines all menu items needed by Tripal Core


tripal_core/api/, line 393
Tripal offers a job management subsystem for managing tasks that may require an extended period of time for completion.


function tripal_execute_job($job_id, $redirect = TRUE) {
  $sql = "SELECT * FROM {tripal_jobs} WHERE job_id = :job_id";
  $results = db_query($sql, array(':job_id' => $job_id));
  $job = $results->fetchObject();

  // set the end time for this job
  if ($job->start_time == 0 and $job->end_time == 0) {
    tripal_launch_job(1, $job_id);
    drupal_set_message(t("Job %job_id has finished executing. See below for more information.", array('%job_id' => $job_id)));
  else {
    drupal_set_message(t("Job %job_id cannot be executed. It has already finished.", array('%job_id' => $job_id)));

  if ($redirect) {