summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2018-11-08 10:53:23 -0800
committerIvan Kohler <ivan@freeside.biz>2018-11-08 10:53:23 -0800
commitae27d43bf9b2bbd8126e4fe1f7c38bba2c4a0407 (patch)
treea3ffc37f771ce4b679dd983ca0b3f30f34473f1e
parent627682145a5dc1b2e2f4eddc5042383b363b830c (diff)
add option for multi-process billing to queue additional jobs for the same customer instead of skipping them, RT#81698
-rw-r--r--FS/FS/Cron/bill.pm2
1 files changed, 2 insertions, 0 deletions
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);
}