Bugzilla – Attachment 132246 Details for
Bug 30350
Do not hardcode job types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30350: Avoid hardcoding job types in background_jobs_worker.pl
Bug-30350-Avoid-hardcoding-job-types-in-background.patch (text/plain), 1.59 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-03-25 13:06:33 UTC
(
hide
)
Description:
Bug 30350: Avoid hardcoding job types in background_jobs_worker.pl
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-03-25 13:06:33 UTC
Size:
1.59 KB
patch
obsolete
>From de94c79e2fb03f15ffcd8e800bcefd288584e081 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 25 Mar 2022 10:02:59 -0300 >Subject: [PATCH] Bug 30350: Avoid hardcoding job types in > background_jobs_worker.pl > >Currently, background_jobs_worker.pl has a hardcoded list of jobs it can >process. Koha::BackgroundJob already has a method that can be used to >extract such list. Using it would avoid having to maintain two lists, >and it would also make it easier to inject plugin tasks as well. > >To test: >1. Apply the patch >2. Restart the koha-worker >3. Run one of the batch operations that make use of the background jobs > (I used batch item delete) >=> SUCCESS: Things work, no change >4. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > misc/background_jobs_worker.pl | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > >diff --git a/misc/background_jobs_worker.pl b/misc/background_jobs_worker.pl >index 5a84d342ba..3032ee38d1 100755 >--- a/misc/background_jobs_worker.pl >+++ b/misc/background_jobs_worker.pl >@@ -28,15 +28,7 @@ try { > warn sprintf "Cannot connect to the message broker, the jobs will be processed anyway (%s)", $_; > }; > >-my @job_types = qw( >- batch_biblio_record_modification >- batch_authority_record_modification >- batch_item_record_modification >- batch_biblio_record_deletion >- batch_authority_record_deletion >- batch_item_record_deletion >- batch_hold_cancel >-); >+my @job_types = keys %{Koha::BackgroundJob::type_to_class_mapping}; > > if ( $conn ) { > # FIXME cf note in Koha::BackgroundJob about $namespace >-- >2.32.0
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 30350
:
132246
|
132298
|
132857