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

8 calls to tripal_set_job_progress()
chado_cleanup_orphaned_nodes_part in legacy/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 legacy/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 legacy/tripal_core/api/tripal_core.chado_nodes.title_and_path.inc
Tripal Job for updating all node URLs for a particular node type.
tripal_analysis_set_feature_permission in legacy/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/api/tripal.jobs.api.inc, line 452
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) {

  try {
    $job = new TripalJob();
    $job->load($job_id);
    $job->setProgress($percentage);
  }
  catch (Exception $e) {
    tripal_report_error('tripal', TRIPAL_ERROR, $e->getMessage());
    drupal_set_message($e->getMessage(), 'error');
    return FALSE;
  }
  return TRUE;
}