From 1a980eb2a78f013e45c20520b3dec84ec54c5b6e Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 3 Jan 2023 15:35:42 +0000 Subject: [PATCH] Bug 32558: Add ability for background_jobs_worker.pl to process multiple jobs simultaneously up to a limit Content-Type: text/plain; charset=utf-8 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 Signed-off-by: Marcel de Rooy --- debian/templates/koha-conf-site.xml.in | 5 +++++ etc/koha-conf.xml | 5 +++++ misc/background_jobs_worker.pl | 22 +++++++++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in index bdb994c517..187150fa6a 100644 --- a/debian/templates/koha-conf-site.xml.in +++ b/debian/templates/koha-conf-site.xml.in @@ -457,6 +457,11 @@ __END_SRU_PUBLICSERVER__ __MESSAGE_BROKER_VHOST__ + + + 1 + + __KEEP_COOKIE__ catalogue_editor_\d+ + 1 + + catalogue_editor_\d+