From: Ivan Kohler Date: Thu, 8 Nov 2018 18:53:20 +0000 (-0800) Subject: add option for multi-process billing to queue additional jobs for the same customer... X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=c93b76cc3c1ca489825eb876cd5e2863e9a1dd62;hp=2db2afe957a655c5048031c86441b900c53f4dd2 add option for multi-process billing to queue additional jobs for the same customer instead of skipping them, RT#81698 --- diff --git a/FS/FS/Cron/bill.pm b/FS/FS/Cron/bill.pm index 68d547633..b0d1f32cc 100644 --- a/FS/FS/Cron/bill.pm +++ b/FS/FS/Cron/bill.pm @@ -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); }