From 9035034a53d60cb7a7687dfee899c1d0c775ea74 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 13 Jul 2007 23:52:23 +0000 Subject: fix race condition where ->apply_payments_and_credits could double-apply in rare cases --- FS/bin/freeside-prepaidd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'FS/bin/freeside-prepaidd') diff --git a/FS/bin/freeside-prepaidd b/FS/bin/freeside-prepaidd index 73f7523c4..a68db3913 100644 --- a/FS/bin/freeside-prepaidd +++ b/FS/bin/freeside-prepaidd @@ -52,9 +52,11 @@ while (1) { warn "Error billing customer #". $cust_main->custnum; next; } - #$b_error = $cust_main->apply_payments_and_credits; - $b_error = $cust_main->apply_payments; - $b_error = $cust_main->apply_credits; + $b_error = $cust_main->apply_payments_and_credits; + if ( $b_error ) { + warn "Error applying payments&credits, customer #". $cust_main->custnum; + next; + } $work_cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $work_cust_pkg->pkgnum } ); -- cgit v1.2.1