[freeside-commits] freeside/FS/FS cdr.pm,1.84,1.85
Ivan,,,
ivan at wavetail.420.am
Tue Jan 3 17:16:02 PST 2012
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv15445/FS/FS
Modified Files:
cdr.pm
Log Message:
optimize CDR rating after timed rate perf regression, RT#15739
Index: cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cdr.pm,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -w -d -r1.84 -r1.85
--- cdr.pm 3 Jan 2012 21:13:32 -0000 1.84
+++ cdr.pm 4 Jan 2012 01:16:00 -0000 1.85
@@ -692,8 +692,11 @@
if ( !exists($interval_cache{$regionnum}) ) {
my @intervals = (
sort { $a->stime <=> $b->stime }
- map { my $r = $_->rate_time; $r ? $r->intervals : () }
- $rate->rate_detail
+ map { $_->rate_time->intervals }
+ qsearch({ 'table' => 'rate_detail',
+ 'hashref' => { 'ratenum' => $rate->ratenum },
+ 'extra_sql' => 'AND ratetimenum IS NOT NULL',
+ })
);
$interval_cache{$regionnum} = \@intervals;
warn " cached ".scalar(@intervals)." interval(s)\n"
@@ -1256,6 +1259,7 @@
sub clear_status {
my $self = shift;
+ my %opt = @_;
local $SIG{HUP} = 'IGNORE';
local $SIG{INT} = 'IGNORE';
@@ -1271,6 +1275,7 @@
if ( $cdr_prerate && $cdr_prerate_cdrtypenums{$self->cdrtypenum}
&& $self->rated_ratedetailnum #avoid putting old CDRs back in "rated"
&& $self->freesidestatus eq 'done'
+ && ! $opt{'rerate'}
)
{ #special case
$self->freesidestatus('rated');
More information about the freeside-commits
mailing list