|
Lines 21-40
background_jobs_worker.pl - Worker script that will process background jobs
Link Here
|
| 21 |
|
21 |
|
| 22 |
=head1 SYNOPSIS |
22 |
=head1 SYNOPSIS |
| 23 |
|
23 |
|
| 24 |
./background_jobs_worker.pl [--job-queue QUEUE] |
24 |
./background_jobs_worker.pl [--queue QUEUE] |
| 25 |
|
25 |
|
| 26 |
=head1 DESCRIPTION |
26 |
=head1 DESCRIPTION |
| 27 |
|
27 |
|
| 28 |
This script will connect to the Stomp server (RabbitMQ) and subscribe to the queues passed in parameter (or the 'default' queue), |
28 |
This script will connect to the Stomp server (RabbitMQ) and subscribe to the queues passed in parameter (or the 'default' queue), |
| 29 |
or if a Stomp server is not active it will poll the database every 10s for new jobs in the passed queue. |
29 |
or if a Stomp server is not active it will poll the database every 10s for new jobs in the passed queue. |
| 30 |
|
30 |
|
| 31 |
You can specify some queues only (using --job-queue, which is repeatable) if you want to run several workers that will handle their own jobs. |
31 |
You can specify some queues only (using --queue, which is repeatable) if you want to run several workers that will handle their own jobs. |
| 32 |
|
32 |
|
| 33 |
=head1 OPTIONS |
33 |
=head1 OPTIONS |
| 34 |
|
34 |
|
| 35 |
=over |
35 |
=over |
| 36 |
|
36 |
|
| 37 |
=item B<--job-queue> |
37 |
=item B<--queue> |
| 38 |
|
38 |
|
| 39 |
Repeatable. Give the job queues this worker will process. |
39 |
Repeatable. Give the job queues this worker will process. |
| 40 |
|
40 |
|
|
Lines 58-64
use Koha::BackgroundJobs;
Link Here
|
| 58 |
my ( $help, @queues ); |
58 |
my ( $help, @queues ); |
| 59 |
GetOptions( |
59 |
GetOptions( |
| 60 |
'h|help' => \$help, |
60 |
'h|help' => \$help, |
| 61 |
'job-queue=s' => \@queues, |
61 |
'queue=s' => \@queues, |
| 62 |
) || pod2usage(1); |
62 |
) || pod2usage(1); |
| 63 |
|
63 |
|
| 64 |
pod2usage(0) if $help; |
64 |
pod2usage(0) if $help; |
| 65 |
- |
|
|