@@ -, +, @@ --- misc/background_jobs_worker.pl | 8 ++++++-- xt/memory_check.t | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) --- a/misc/background_jobs_worker.pl +++ a/misc/background_jobs_worker.pl @@ -21,7 +21,7 @@ background_jobs_worker.pl - Worker script that will process background jobs =head1 SYNOPSIS -./background_jobs_worker.pl [--queue QUEUE] +./background_jobs_worker.pl [--queue QUEUE] [-m] =head1 DESCRIPTION @@ -30,6 +30,7 @@ or if a Stomp server is not active it will poll the database every 10s for new j You can specify some queues only (using --queue, which is repeatable) if you want to run several workers that will handle their own jobs. +-m or --modules will cause the script to print the included Perl modules and exit. =head1 OPTIONS =over @@ -55,14 +56,17 @@ use Getopt::Long; use Koha::BackgroundJobs; -my ( $help, @queues ); +my ( $help, @queues, $modules ); GetOptions( 'h|help' => \$help, 'queue=s' => \@queues, + 'm|modules' => \$modules, ) || pod2usage(1); pod2usage(0) if $help; +if ($modules) { print join "\n", %INC; print "\n"; exit 0; } + unless (@queues) { push @queues, 'default'; } --- a/xt/memory_check.t +++ a/xt/memory_check.t @@ -16,7 +16,8 @@ # along with Koha; if not, see . use Modern::Perl; -use Test::More tests => 1; +use Test::More tests => 2; +use FindBin; my $pid = qx[ps ax | grep 'background_jobs_worker.pl --queue default' | grep -v grep | tail -n1 | awk '{print \$1}']; @@ -34,3 +35,6 @@ SKIP: { pass("background_jobs_worker.pl is consuming $memory_usage in memory"); } } + +my $output = qx{$FindBin::Bin/../misc/background_jobs_worker.pl -m | grep 'Koha/Plugins.pm'}; +is( $output, q{}, "Koha::Plugins not loaded by background_jobs_worker.pl" ); --