Bugzilla – Attachment 143864 Details for
Bug 31995
build_holds_queue.pl should check to see if the RealTime syspref is on
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31995: build_holds_queue.pl should check to see if the RealTimeHoldsQueue syspref is on [v22.05]
Bug-31995-buildholdsqueuepl-should-check-to-see-if.patch (text/plain), 3.54 KB, created by
Kyle M Hall (khall)
on 2022-11-14 19:27:39 UTC
(
hide
)
Description:
Bug 31995: build_holds_queue.pl should check to see if the RealTimeHoldsQueue syspref is on [v22.05]
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-11-14 19:27:39 UTC
Size:
3.54 KB
patch
obsolete
>From 11d935f6966ef1599ff7fbe3a1c5f00efaae49c9 Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Thu, 27 Oct 2022 13:44:59 -0400 >Subject: [PATCH] Bug 31995: build_holds_queue.pl should check to see if the > RealTimeHoldsQueue syspref is on [v22.05] > >The real time hold queue and the build_holds_queue.pl jobs are not 100% compatible in that we should not be running the cron if the real time queue is enabled, this could lead to double server work. It would be good to have a check in build_holds_queue for the RealTimeHoldsQueue syspref and not run the job if the preference is enabled. > >There might be times when we'd want to force a run of this job without changing the syspref. To that end we would also want a flag for this job so that system administrators could force the job from the command line if required, overriding this limitation. > >Test Plan: >1) Apply this patch >2) Try run misc/cronjobs/holds/build_holds_queue.pl with the -h/--help and -m/--man options >3) Disable RealTimeHoldsQueue >4) Run with no options, should succeed >5) Enable RealTimeHoldsQueue >6) Run with no options, should display a message and not rebuild the > holds queue >7) Run again with the -f/--force option, should succeed > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Bug 31995: (QA follow-up) Add 'system preference' to help text > >We often get asked where something can be found in setting, >adding the hint that RealTimeHoldsQueue is a system preference >is hopefully helpful here. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > misc/cronjobs/holds/build_holds_queue.pl | 69 ++++++++++++++++++++++-- > 1 file changed, 65 insertions(+), 4 deletions(-) > >diff --git a/misc/cronjobs/holds/build_holds_queue.pl b/misc/cronjobs/holds/build_holds_queue.pl >index 6ba476b585..9cf2d63a3b 100755 >--- a/misc/cronjobs/holds/build_holds_queue.pl >+++ b/misc/cronjobs/holds/build_holds_queue.pl >@@ -6,14 +6,75 @@ > # FIXME: add command-line options for verbosity and summary > # FIXME: expand perldoc, explain intended logic > >-use strict; >-use warnings; >+use Modern::Perl; > >-use Koha::Script -cron; >+use Getopt::Long qw( GetOptions ); >+use Pod::Usage qw( pod2usage ); >+ >+use C4::Context; > use C4::HoldsQueue qw(CreateQueue); > use C4::Log qw( cronlogaction ); >+use Koha::Script -cron; >+ >+=head1 NAME >+ >+build_holds_queue.pl - Rebuild the holds queue >+ >+=head1 SYNOPSIS >+ >+build_holds_queue.pl [-f] >+ >+ Options: >+ -h --help Brief help message >+ -m --man Full documentation >+ -f --force Run holds queue builder even if RealTimeHoldsQueue is enabled >+ >+=head1 OPTIONS >+ >+=over 8 >+ >+=item B<--help> >+ >+Print a brief help message and exits. >+ >+=item B<--man> >+ >+Prints the manual page and exits. >+ >+=item B<--force> >+ >+Allows this script to rebuild the entire holds queue even if the RealTimeHoldsQueue system preference is enabled. >+ >+=back >+ >+=head1 DESCRIPTION >+ >+This script builds or rebuilds the entire holds queue. >+ >+=cut >+ >+my $help = 0; >+my $man = 0; >+my $force = 0; >+ >+my $command_line_options = join( " ", @ARGV ); >+ >+GetOptions( >+ 'h|help' => \$help, >+ 'm|man' => \$man, >+ 'f|force' => \$force, >+); >+pod2usage(1) if $help; >+pod2usage( -exitval => 0, -verbose => 2 ) if $man; >+ >+my $rthq = C4::Context->preference('RealTimeHoldsQueue'); >+ >+if ( $rthq && !$force ) { >+ say "RealTimeHoldsQueue system preference is enabled, holds queue not built."; >+ say "Use --force to force building the holds queue."; >+ exit(1); >+} > > cronlogaction(); > > CreateQueue(); >- >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31995
:
142725
|
142798
|
143016
|
143017
| 143864