better retry behavior for non-found taqua CDR rewrites, RT#12181
authorivan <ivan>
Mon, 9 May 2011 20:25:57 +0000 (20:25 +0000)
committerivan <ivan>
Mon, 9 May 2011 20:25:57 +0000 (20:25 +0000)
FS/bin/freeside-cdrrewrited

index a365d73..09a2643 100644 (file)
@@ -41,12 +41,12 @@ while (1) {
   # rewritten "skipped", i.e. why we're a daemon in the first place
   # instead of just doing this search like normal CDRs
 
+  #hmm :/
   my @recent = grep { ($accountcode_unmatch{$_} + $accountcode_retry) < time }
                  keys %accountcode_unmatch;
-  #hmm :/
-  my $extra_sql = '';
-  $extra_sql .= ' AND acctid NOT IN (', join(',', @recent). ') '
-    if @recent;
+  my $extra_sql = scalar(@recent)
+                    ? ' AND acctid NOT IN (', join(',', @recent). ') '
+                    : '';
 
   my $found = 0;
   foreach my $cdr (