LP#1508208: Only look at holds that age protection allows user/miker/lp-1508208-age_protect_hold_capture
authorMike Rylander <mrylander@gmail.com>
Tue, 10 Dec 2019 22:17:38 +0000 (17:17 -0500)
committerMike Rylander <mrylander@gmail.com>
Wed, 8 Apr 2020 14:05:38 +0000 (10:05 -0400)
commit03997cf830802e7601152cf999d8a05751df03d0
treeb6fc8766bd7991b25e4b5c125d937003e2cac49b
parent5f50e2f71f3261201f560fc4c9acc6c5a04a7a40
LP#1508208: Only look at holds that age protection allows

When hold capture is attempted, we look at (currently) the first 100
holds ordered by Best Hold Sort Selection Order.  If a very long list
of holds are targetting an age-protected item then op capture may not
have a chance to see a viable hold for that copy.

This commit attempts to take into account the age protection currently
set for the copy by restricting the holds to just those where the
hold-copy-map proximity is less than or equal to the maximum proximity
allowed by the age protection.  This works now because we store the
hold proximity in the hold copy map, where we did not before.

Being based on the hold-copy-map proximity, which is calculated
proximity, means this is an approximation and the final hold capture
logic may still reject some holds for the copy.  Likewise, this does
not entirely eliminate the possibility that there may be a better hold
to capture the copy for if the in-range set of holds is very, very
long, but this should allow hold capture to proceed if even
imperfectly.

If no age protection is set for the copy, the current behavior
(looking at all holds) is maintained.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm