function tripal_job_set_progress
2.x tripal_core.DEPRECATED.api.inc | tripal_job_set_progress($job_id, $percentage) |
3.x tripal_core.DEPRECATED.inc | tripal_job_set_progress($job_id, $percentage) |
1.x tripal_core_jobs.api.inc | tripal_job_set_progress($job_id, $percentage) |
An internal function for setting the progress for a current job
Parameters
$job_id: The job_id to set the progress for
$percentage: The progress to set the job to
Return value
True on success and False otherwise
Related topics
20 calls to tripal_job_set_progress()
- tripal_analysis_set_feature_permission in tripal_analysis/
includes/ tripal_analysis_privacy.inc - Set permissions for features associated with an analysis @todo Stephen: ensure the $nid param is defined correctly
- tripal_bulk_loader_load_data in tripal_bulk_loader/
includes/ tripal_bulk_loader.loader.inc - Tripal Bulk Loader
- tripal_bulk_loader_progess_file_get_progress in tripal_bulk_loader/
tripal_bulk_loader.module - Get the progress of the current constant set from the progress file
- tripal_core_clean_orphaned_nodes in tripal_core/
api/ tripal_core_chado.api.inc - This function will delete Drupal nodes for any sync'ed table (e.g. feature, organism, analysis, stock, library) if the chado record has been deleted or the entry in the chado_[table] table has been removed.
- tripal_cv_obo_load_typedefs in tripal_cv/
includes/ obo_loader.inc
File
- tripal_core/
api/ tripal_core_jobs.api.inc, line 315 - Contains functions related to the Tripal Jobs API
Code
function tripal_job_set_progress($job_id, $percentage) {
if (preg_match("/^(\d+|100)$/", $percentage)) {
$record = new stdClass();
$record->job_id = $job_id;
$record->progress = $percentage;
if (drupal_write_record('tripal_jobs', $record, 'job_id')) {
return TRUE;
}
}
return FALSE;
}