function tripal_get_job
2.x tripal_core.jobs.api.inc | tripal_get_job($job_id) |
3.x tripal.jobs.api.inc | tripal_get_job($job_id) |
Retrieve information regarding a tripal job
Parameters
$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
File
- tripal_core/
api/ tripal_core.jobs.api.inc, line 156 - Tripal offers a job management subsystem for managing tasks that may require an extended period of time for completion.
Code
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))
->fetchObject();
$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;
}