Browse Source

Add testing messages

Abdullah Almsaeed 8 years ago
parent
commit
10780453ac
1 changed files with 9 additions and 1 deletions
  1. 9 1
      tripal_core/api/tripal_core.jobs.api.inc

+ 9 - 1
tripal_core/api/tripal_core.jobs.api.inc

@@ -278,6 +278,14 @@ function tripal_cancel_job($job_id, $redirect = TRUE) {
 }
 }
 
 
 
 
+/**
+ * Execute a specific Tripal Job.
+ *
+ * @param $job_id
+ *          The job id to be exeuted
+ * @param bool $redirect [optional]
+ *          Whether to redirect to the job page or not
+ */
 function tripal_execute_job($job_id, $redirect = TRUE) {
 function tripal_execute_job($job_id, $redirect = TRUE) {
   global $user;
   global $user;
 
 
@@ -289,7 +297,7 @@ function tripal_execute_job($job_id, $redirect = TRUE) {
   if ($job->end_time == 0) {
   if ($job->end_time == 0) {
     $cmd = "drush trp-run-jobs --job_id=".escapeshellarg($job_id)." --username=".escapeshellarg($user->name)." --root=".DRUPAL_ROOT."";
     $cmd = "drush trp-run-jobs --job_id=".escapeshellarg($job_id)." --username=".escapeshellarg($user->name)." --root=".DRUPAL_ROOT."";
     $o = exec($cmd, $output, $return);
     $o = exec($cmd, $output, $return);
-    drupal_set_message($cmd);
+    drupal_set_message($cmd.' '.$o);
   }
   }
   else {
   else {
     drupal_set_message(t("Job %job_id cannot be executed. It is in progress or has finished.", array('%job_id' => $job_id)));
     drupal_set_message(t("Job %job_id cannot be executed. It is in progress or has finished.", array('%job_id' => $job_id)));