Bug 32558: Add ability for background_jobs_worker.pl to process multiple jobs simulta...
authorKyle M Hall <kyle@bywatersolutions.com>
Tue, 3 Jan 2023 15:35:42 +0000 (15:35 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Fri, 10 Mar 2023 17:16:38 +0000 (17:16 +0000)
commit7c76176b85fb4f4a8ce03b41e42629821ae1d80f
tree025cd47f7e928768d8b3f811be0a5159ce80ad90
parent519b4f2b59832f5ce5975add20dc8461ad7ca9bc
Bug 32558: Add ability for background_jobs_worker.pl to process multiple jobs simultaneously up to a limit

Right now background_jobs_worker.pl only processes jobs in serial. It would make sense to handle jobs in parallel up to a user definable limit.

Test Plan:
1) Apply this patch
2) Stop background_jobs_worker.pl
3) Generate some background jobs by editing records, placing holds, etc
4) Watch processes in a new terminal: watch -n 0.1 'ps aux | grep background_jobs_worker.pl'
5) Run background_jobs_worker.pl with parameter -m 3 or some other
   number of max processes
6) Note the multiple forked processes in the ps output

Test notes - also tested the following on KTD:
1. Stop background_jobs_worker.pl
2. Edit /etc/koha/sites/kohadev/koha-conf.xml - set max_processes to 10
3. Generate some background jobs
4. Watch processes in a new terminal: watch -n 0.1 'ps aux | grep background_jobs_worker.pl'
5. Restart all
6. Confirm multiple forked processes in the ps output

Both methods work as expected and generate multiple forked processes
based on the value set for max processes.

Signed-off-by: emlam <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 311d68815fa69d66d948c023651c07271a0248c9)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 95a5d612f36cd3b06a184106a217fbc1e1716577)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
debian/templates/koha-conf-site.xml.in
etc/koha-conf.xml
misc/background_jobs_worker.pl