add option for multi-process billing to queue additional jobs for the same customer...
authorIvan Kohler <ivan@freeside.biz>
Thu, 8 Nov 2018 18:53:20 +0000 (10:53 -0800)
committerIvan Kohler <ivan@freeside.biz>
Thu, 8 Nov 2018 18:53:20 +0000 (10:53 -0800)
FS/FS/Cron/bill.pm

index 68d5476..b0d1f32 100644 (file)
@@ -117,6 +117,7 @@ sub bill {
                                  }
                               );
 
+          #avoid queuing another job if there's one still waiting to run
           next if @waiting && ! $opt{'q'};
 
           #add job to queue that calls bill_and_collect with options
@@ -128,6 +129,7 @@ sub bill {
           my $error = $queue->insert( 'custnum'=>$custnum, %args );
           die $error if $error;
 
+          #wait until the earler jobs complete
           foreach $waiting_queue (@waiting) {
             $queue->depend_insert($waiting_queue->jobnum);
           }