JBAS-1741 Hold targeter v2 gets KCLS has-checked-out-copy
authorBill Erickson <berickxx@gmail.com>
Fri, 24 Jun 2016 20:56:58 +0000 (16:56 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
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 <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm

index a42638c..a721f8a 100644 (file)
@@ -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;