From: Bill Erickson Date: Fri, 10 Jun 2016 21:18:18 +0000 (-0400) Subject: hold targeter reify experiment X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0501eafe2f30ef7e6ed2098408ad80aebc8b1003;p=working%2FEvergreen.git hold targeter reify experiment Signed-off-by: Bill Erickson --- 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.