function tripal_set_job_progress

2.x tripal_core.jobs.api.inc tripal_set_job_progress($job_id, $percentage)
3.x tripal.jobs.api.inc tripal_set_job_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

14 calls to tripal_set_job_progress()
chado_cleanup_orphaned_nodes_part in tripal_core/api/tripal_core.chado_nodes.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.
chado_node_sync_records in tripal_core/api/tripal_core.chado_nodes.api.inc
Generic function for syncing records in Chado with Drupal nodes.
chado_update_existing_node_urls in tripal_core/api/tripal_core.chado_nodes.title_and_path.api.inc
Tripal Job for updating all node URLs for a particular node type.
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

... See full list

1 string reference to 'tripal_set_job_progress'

File

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

Code

function tripal_set_job_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;
}