summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2011-06-10 23:32:37 +0000
committerivan <ivan>2011-06-10 23:32:37 +0000
commitd75211d6100352764fb6753c411ee2fe8491d13c (patch)
tree06dabbedaa0ba8727cf984f24aed749b794c0d81
parentfaae79a7b3f88dc0df82e456b2aca9ff977407d1 (diff)
alternate (hopefully more efficient) path: if we're more than a day behind, call native torrus srvderive, RT#10574
-rw-r--r--FS/bin/freeside-torrus-srvderive4
1 files changed, 3 insertions, 1 deletions
diff --git a/FS/bin/freeside-torrus-srvderive b/FS/bin/freeside-torrus-srvderive
index 6a9c3a2c3..4e08c6ef3 100644
--- a/FS/bin/freeside-torrus-srvderive
+++ b/FS/bin/freeside-torrus-srvderive
@@ -142,7 +142,9 @@ while (1) {
#behind, call native torrus srvderive
my $last_srv_date = $torrus_srvderive->last_srv_date;
my $currdate = time2str('%Y-%m-%d', time);
- if ( $last_srv_date ne $currdate ) {
+ if ( $last_srv_date ne $currdate
+ && time - str2time($last_srv_date) > (24+6)*60*60 #6 hour window for
+ ) { #yesterday
warn "serviceid $serviceid last_srv_date != $currdate\n" if $DEBUG;
#delete records from last_srv_date