[open-ils-commits] r20068 - branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Apr 13 12:14:50 EDT 2011
Author: miker
Date: 2011-04-13 12:14:47 -0400 (Wed, 13 Apr 2011)
New Revision: 20068
Modified:
branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm
Log:
Protect search against all-deleted bibs by pinning the estimation ratios in that case
Modified: branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm
===================================================================
--- branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm 2011-04-13 16:13:14 UTC (rev 20067)
+++ branches/rel_2_1/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm 2011-04-13 16:14:47 UTC (rev 20068)
@@ -2657,10 +2657,10 @@
my $delete_adjusted_total = $total - ( $total * $deleted_ratio );
my $exclusion_ratio = $excluded / $checked;
- my $delete_adjusted_exclusion_ratio = $excluded / ($checked - $deleted);
+ my $delete_adjusted_exclusion_ratio = $checked - $deleted ? $excluded / ($checked - $deleted) : 1;
my $inclusion_ratio = $visible / $checked;
- my $delete_adjusted_inclusion_ratio = $visible / ($checked - $deleted);
+ my $delete_adjusted_inclusion_ratio = $checked - $deleted ? $visible / ($checked - $deleted) : 0;
return {
exclusion => int($delete_adjusted_total - ( $delete_adjusted_total * $exclusion_ratio )),
More information about the open-ils-commits
mailing list