summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2011-05-09 22:12:19 +0000
committerivan <ivan>2011-05-09 22:12:19 +0000
commit7fb4524a6efd3aeffe137b1bb42141f38d7be988 (patch)
treed20f130d109748fafc22187517c0274c0db3eceb
parentf0926d220112f41d3e5becd48612ee4f6db808c4 (diff)
better retry behavior for non-found taqua CDR rewrites, RT#12181
-rw-r--r--FS/bin/freeside-cdrrewrited6
1 files changed, 4 insertions, 2 deletions
diff --git a/FS/bin/freeside-cdrrewrited b/FS/bin/freeside-cdrrewrited
index 7c759f5c3..ac0a1ce4f 100644
--- a/FS/bin/freeside-cdrrewrited
+++ b/FS/bin/freeside-cdrrewrited
@@ -42,7 +42,7 @@ while (1) {
# instead of just doing this search like normal CDRs
#hmm :/
- my @recent = grep { ($accountcode_unmatch{$_} + $accountcode_retry) < time }
+ my @recent = grep { ($accountcode_unmatch{$_} + $accountcode_retry) > time }
keys %accountcode_unmatch;
my $extra_sql = scalar(@recent)
? ' AND acctid NOT IN ('. join(',', @recent). ') '
@@ -105,9 +105,11 @@ while (1) {
my $cantfind = "can't find primary CDR with session ". $cdr->sessionnum.
", src ". $cdr->subscriber;
- if ( $cdr->calldate_unix - $accountcode_giveup > time ) {
+ if ( $cdr->calldate_unix + $accountcode_giveup < time ) {
+ warn" ERROR: $cantfind; giving up\n";
push @status, 'taqua-accountcode-NOTFOUND';
$cdr->status('done'); #so it doesn't try to rate
+ delete $accountcode_unmatch($cdr->acctid}; #so it doesn't suck mem
} else {
warn "WARNING: $cantfind; will keep trying\n";
$accountcode_unmatch{$cdr->acctid} = time;