$sth->execute($serviceid, $serviceid) or die $sth->errstr;
my $prev = 0;
while ( my $row = $sth->fetchrow_arrayref ) {
- $found++;
my( $srv_date, $srv_time ) = @$row;
my $cur = str2time( "$srv_date $srv_time" );
next if $cur-$prev <= 60;
warn "no $serviceid for $srv_date $srv_time; adding\n"
if $DEBUG;
+ $found++;
my @serviceids = $torrus_srvderive->component_serviceids;
myexit() if sigterm() || sigint();
- sleep 60; # unless $found;
+ sleep 60 unless $found;
}
sub _shouldrun {