[freeside-commits] freeside/FS/bin freeside-torrus-srvderive, 1.12, 1.13
Ivan,,,
ivan at wavetail.420.am
Sun Feb 27 11:39:28 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv28951/FS/bin
Modified Files:
freeside-torrus-srvderive
Log Message:
add start of torrus srvderive daemon, RT#10574
Index: freeside-torrus-srvderive
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-torrus-srvderive,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -d -r1.12 -r1.13
--- freeside-torrus-srvderive 27 Feb 2011 19:34:09 -0000 1.12
+++ freeside-torrus-srvderive 27 Feb 2011 19:39:26 -0000 1.13
@@ -71,6 +71,7 @@
my( $srv_date, $srv_time ) = @$row;
my $cur = str2time( "$srv_date $srv_time" );
next if $cur-$prev <= 60;
+ last if time - $cur <= 300;
warn "no $serviceid for $srv_date $srv_time; adding\n"
if $DEBUG;
@@ -82,7 +83,7 @@
my $sin = join(',', map dbh->quote("$_$dir"), @serviceids);
my $sum = "
- SELECT SUM(value) FROM srvexport AS other
+ SELECT COALESCE(SUM(value),0) FROM srvexport AS other
WHERE other.serviceid IN ($sin)
AND ABS( $cur - $other_date ) <= 60
";
More information about the freeside-commits
mailing list