Parcourir la source

Fixed off by one error in the job launcher

Lacey Sanderson il y a 8 ans
Parent
commit
d8a67ee2a3

+ 3 - 3
tripal_core/api/tripal_core.jobs.api.inc

@@ -302,7 +302,7 @@ function tripal_max_jobs_exceeded($max_jobs) {
     }
   }
 
-  return ($num_jobs_running > $max_jobs);
+  return ($num_jobs_running >= $max_jobs);
 }
 
 
@@ -430,12 +430,12 @@ function tripal_launch_job($do_parallel = 0, $job_id = NULL, $max_jobs = -1, $si
   // if they are, don't continue, we don't want to have
   // more than one job script running at a time
   if (!$do_parallel and tripal_is_job_running()) {
-    print "Jobs are still running. Use the --parallel=1 option with the Drush command to run jobs in parallel.";
+    print "Jobs are still running. Use the --parallel=1 option with the Drush command to run jobs in parallel.\n";
     return;
   }
 
   if ($do_parallel && tripal_max_jobs_exceeded($max_jobs)) {
-    print "More than $max_jobs jobs are still running. At least one of these jobs much complete before a new job can start.";
+    print "At least $max_jobs jobs are still running. At least one of these jobs much complete before a new job can start.\n";
     return;
   }
 

+ 1 - 0
tripal_core/tripal_core.drush.inc

@@ -326,6 +326,7 @@ function drush_tripal_core_trp_run_jobs() {
   drush_print("\n" . date('Y-m-d H:i:s'));
   if ($parallel) {
     drush_print("Tripal Job Launcher (in parallel)");
+    if ($max_jobs !== -1) drush_print("Maximum number of jobs is " . $max_jobs);
     drush_print("Running as user '$username'");
     drush_print("-------------------");
     tripal_launch_job($parallel, $job_id, $max_jobs, $single);