[open-ils-commits] r20069 - trunk/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:15:14 EDT 2011
Author: miker
Date: 2011-04-13 12:15:11 -0400 (Wed, 13 Apr 2011)
New Revision: 20069
Modified:
trunk/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: trunk/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm 2011-04-13 16:14:47 UTC (rev 20068)
+++ trunk/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm 2011-04-13 16:15:11 UTC (rev 20069)
@@ -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