function tripal_get_job

2.x tripal_get_job($job_id)

Retrieve information regarding a tripal job


$job_id: The unique identifier of the job

Return value

An object describing the job if a job is found or FALSE on failure.

Related topics


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


function tripal_get_job($job_id) {
  if (!$job_id or !is_numeric($job_id)) {
    watchdog('tripal', "Must provide a numeric \$job_id to the tripal_cancel_job() function.");
    return FALSE;

  $job = db_query('SELECT j.* FROM {tripal_jobs} j WHERE j.job_id=:job_id', array(':job_id' => $job_id))

  $job->submit_date_string = format_date($job->submit_date);
  $job->start_time_string = format_date($job->start_time);
  $job->end_time_string = format_date($job->end_time);

  return $job;