alternate (hopefully more efficient) path: if we're more than a day behind, call...
authorivan <ivan>
Fri, 10 Jun 2011 23:32:37 +0000 (23:32 +0000)
committerivan <ivan>
Fri, 10 Jun 2011 23:32:37 +0000 (23:32 +0000)
FS/bin/freeside-torrus-srvderive

index 6a9c3a2..4e08c6e 100644 (file)
@@ -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