LP#
1596595 Hold targeter refactoring and optimization.
* Ports hold targeter code to a Perl utility function, communicating w/
the DB via cstore instead of storage.
* Adds a new global flag 'circ.holds.retarget_interval' for configuring
the hold retarget interval in the database.
* Adds a new DB function to regenerating hold copy maps to make map
deletion and creation more efficient.
* Adds an option for targeting holds in newest to oldest order.
* Caches all org unit settings per targeter run.
* Adds support for "skip_viable" option. This tells the hold targeter
to avoid modifying any holds that target viable copies. AKA "fix
broken" mode.
For example, you might run in skip_viable mode with a retarget
interval of 24hr once a day to repair non-viable holds, then also run
the targeter in regular mode once a day with a retarget interval of 48
hours to give staff 2 days to process viable holds.
* Hold target loops logic changes:
** Org units with fewer target attempts are prioritized during loop
processing. So, instead of segregating org units into 2 categetories,
those attempted in the current loop and those not attempted, sort those
not attempted by the number number of times they have been attempted.
Within each grouping, prioritize by target weight/proximity as before.
** All org units that have been attempted less than the max configured
amount are on the table for targeting, not just those that have been
targeted less than the current loop max. If no orgs with
less-than-current-max attempts are found, try orgs that match the
current max (but are still less than the configured max).
** When activated, target looping treats the pickup lib like any
other org unit. If a targeted copy at the pickup lib remains
un-captured, at re-target time, a copy at a different branch is
chosen (if one is available) even if other copies at the pickup
lib are targetable.
* Logging / code refactoring and clean up.
Signed-off-by: Bill Erickson <berickxx@gmail.com>