use FS::torrus_srvderive;
our $DEBUG = 2;
-our $max_kids = 6;
+our $max_kids = 12;
our $search_timeout = 60*60; #30*60; # 15*60 5*60; #$torrus_srvderive->last_srv_date ? 5*60 : 15*60);
our %kids;
my $orderlimit = "
ORDER BY srv_date, srv_time
- LIMIT 50
+ LIMIT 100
";
if ( driver_name =~ /mysql/i ) {
AND other.srv_date = '$srv_date'
AND ABS( $cur - $other_date ) <= 60
";
+ my $ssth = dbh->prepare($sum) or die $DBI::errstr;
+ $ssth->execute or die $ssth->errstr; #better recovery?
+ my $value = $ssth->fetchrow_arrayref->[0];
my $isql = "
- INSERT INTO srvexport ( srv_date, srv_time, serviceid, value, intvl )
- VALUES ( ?, ?, ?, ($sum), ? )
+ INSERT INTO srvexport (srv_date, srv_time, serviceid, value, intvl)
+ VALUES ( ?, ?, ?, ?, ? )
";
my @param = ( $srv_date,
time2str('%X', $cur), #srv_time
"$serviceid$dir", #serviceid
+ $value,
300, #intvl ...
);
warn $isql. ' with param '. join(',',@param). "\n"