From: Bill Erickson Date: Fri, 19 Jan 2018 15:56:53 +0000 (-0500) Subject: LP#1744341 Hold targeter --retarget-frozen option X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=750bf745b62fdca42fec544a52ff0bb4a215f68c;p=working%2FEvergreen.git LP#1744341 Hold targeter --retarget-frozen option New --retarget-frozen option allows the targeter to include frozen holds in batch retarget mode. This lets admins periodically update hold copy maps for frozen holds, which can accumulate links to deleted and otherwise unholdable copies over time, skewing the hold queueu positition calculation. Commit includes release notes. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/HoldTargeter.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/HoldTargeter.pm index afca2fcc9e..da0c81bbeb 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/HoldTargeter.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/HoldTargeter.pm @@ -59,6 +59,10 @@ parallel_count => n parallel_slot => n [starts at 1] Sets the parallel targeter instance slot. Used to determine which holds to process to avoid conflicts with other running instances. + +retarget_frozen => 1 + Include frozen holds in batch hold retarget mode. This allows the + targeter to refresh frozen hold copy maps which get stale over time. / } ], diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm index 31b8852cb0..317780d6e2 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/HoldTargeter.pm @@ -47,6 +47,8 @@ sub find_holds_to_target { return ($self->{hold}); } + my %frozen_filter = $self->{retarget_frozen} ? () : (frozen => 'f'); + my $query = { select => {ahr => ['id']}, from => 'ahr', @@ -54,7 +56,7 @@ sub find_holds_to_target { capture_time => undef, fulfillment_time => undef, cancel_time => undef, - frozen => 'f' + %frozen_filter }, order_by => [ {class => 'ahr', field => 'selection_depth', direction => 'DESC'}, diff --git a/Open-ILS/src/support-scripts/hold_targeter.pl b/Open-ILS/src/support-scripts/hold_targeter.pl index 93eaf4d0f9..153e35d4ed 100755 --- a/Open-ILS/src/support-scripts/hold_targeter.pl +++ b/Open-ILS/src/support-scripts/hold_targeter.pl @@ -20,6 +20,7 @@ my $lockfile = '/tmp/hold_targeter-LOCK'; my $parallel = 0; my $verbose = 0; my $retarget_interval; +my $retarget_frozen; my $soft_retarget_interval; my $next_check_interval; my $recv_timeout = 3600; @@ -36,6 +37,7 @@ GetOptions( 'verbose' => \$verbose, 'parallel-init-sleep=i' => \$parallel_init_sleep, 'retarget-interval=s' => \$retarget_interval, + 'retarget-frozen' => \$retarget_frozen, 'next-check-interval=s' => \$next_check_interval, 'soft-retarget-interval=s' => \$soft_retarget_interval, ) || die "\nSee --help for more\n"; @@ -102,6 +104,10 @@ Targeting Options requested interval. Overrides the 'circ.holds.retarget_interval' global_flag value. + --retarget-frozen + Include frozen holds in batch hold retarget mode. This allows the + targeter to refresh frozen hold copy maps which get stale over time. + HELP exit(0); @@ -147,6 +153,7 @@ sub run_batches { parallel_count => $parallel, parallel_slot => $slot, retarget_interval => $retarget_interval, + retarget_frozen => $retarget_frozen, next_check_interval => $next_check_interval, soft_retarget_interval => $soft_retarget_interval } diff --git a/docs/RELEASE_NOTES_NEXT/Administration/hold-retarget-frozen.adoc b/docs/RELEASE_NOTES_NEXT/Administration/hold-retarget-frozen.adoc new file mode 100644 index 0000000000..3f8b1fb5e9 --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/Administration/hold-retarget-frozen.adoc @@ -0,0 +1,13 @@ +Hold Targter --retarget-frozen option +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Adds a new --retarget-frozen option to hold_targeter_v2.pl that informs +the hold targeter to include frozen holds in batch hold retarget +mode. This allows the targeter to refresh frozen hold copy maps which +get stale over time, leading to potentially bogus queue position +calculations. + +This functionality is included as an option and not baked into the +targeter based on the assumption that admins may wish to only retarget +frozen holds at certain times, since including frozen holds can extend +the overall targeter run time. +