From c728781dcc661c2ea4b0679491472abc51598ef6 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 2 Aug 2012 12:27:45 -0400 Subject: [PATCH] Bug 8562 - RandomizeHoldsQueueWeight ignored if StaticHoldsQueueWeight is empty. If StaticHoldsQueueWeight is empty, but RandomizeHoldsQueueWeight is enabled, the script build_holds_queue.pl should select branches for fulfillment requests at random. Instead, it will select them in alphabetical order. This patch forces randomization in the event that StaticHoldsQueueWeight is empty, under the assumption that no library would wish to have libraries fulfill hold requests in alphabetical order. --- misc/cronjobs/holds/build_holds_queue.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/misc/cronjobs/holds/build_holds_queue.pl b/misc/cronjobs/holds/build_holds_queue.pl index f01153e..954339c 100755 --- a/misc/cronjobs/holds/build_holds_queue.pl +++ b/misc/cronjobs/holds/build_holds_queue.pl @@ -286,7 +286,7 @@ sub MapItemsToHoldRequests { if ($#branches_to_use > -1) { @pull_branches = @branches_to_use; } else { - @pull_branches = sort keys %items_by_branch; + @pull_branches = shuffle keys %items_by_branch; } foreach my $branch (@pull_branches) { next unless exists $items_by_branch{$branch} and -- 1.7.2.5