From 0501eafe2f30ef7e6ed2098408ad80aebc8b1003 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 10 Jun 2016 17:18:18 -0400 Subject: [PATCH] hold targeter reify experiment Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm index 4a3ea9cddb..03e579ac66 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm @@ -367,7 +367,6 @@ sub get_hold_copies { fkey => 'status' }; - $query->{where}->{'+acp'}->{circulate} = 't'; $query->{where}->{'+acp'}->{holdable} = 't'; $query->{where}->{'+acp'}->{mint_condition} = 't' if $U->is_true($hold->mint_condition); @@ -466,13 +465,17 @@ sub update_copy_maps { my $self = shift; my $e = $self->editor; - $e->json_query({from => [ + my $resp = $e->json_query({from => [ 'action.hold_request_regen_copy_maps', $self->hold_id, '{' . join(',', map {$_->{id}} @{$self->copies}) . '}' ]}); - return 1; + # The above call can fail if another process is updating + # copy maps for this hold at the same time. + return 1 if $resp && @$resp; + + return $self->exit_targeter("Error creating hold copy maps"); } # Returns a map of proximity values to arrays of copy hashes. -- 2.11.0