From: Bill Erickson Date: Fri, 24 Jun 2016 20:56:58 +0000 (-0400) Subject: JBAS-1741 Hold targeter v2 gets KCLS has-checked-out-copy X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=905a1cf353bec632f00d0974a5ba745051e30339;p=working%2FEvergreen.git JBAS-1741 Hold targeter v2 gets KCLS has-checked-out-copy Cross-port code to implement KCLS policy of leaving holds alive so long as a checked out copy exists regardless of whether the targeter has reached max org unit target attempt loops. 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 a42638c806..a721f8a06a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm @@ -985,6 +985,12 @@ sub target_by_org_loops { # back to waiting for another copy (or retargets its current copy). return undef if $max_tried < $max_loops; + if (@{$self->recall_copies}) { # KCLS + $self->log_hold("Skipping max-loops cancellation because ". + "there is at least one checked out copy in circulation"); + return undef; + } + # At least one lib has been targeted max-loops times and zero # other copies are targetable. All options have been exhausted. return $self->handle_exceeds_target_loops;