Bugzilla – Attachment 189567 Details for
Bug 41248
Add ability for real time holds queue background jobs to skip duplicate jobs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41248: Add ability for real time holds queue background jobs to skip duplicate jobs (edit)
7d3b2c2.patch (text/plain), 1.74 KB, created by
Kyle M Hall (khall)
on 2025-11-13 15:29:01 UTC
(
hide
)
Description:
Bug 41248: Add ability for real time holds queue background jobs to skip duplicate jobs (edit)
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2025-11-13 15:29:01 UTC
Size:
1.74 KB
patch
obsolete
>From 7d3b2c2feade1957cc6aa8c3c476d5c1b173ada8 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 13 Nov 2025 09:40:00 -0500 >Subject: [PATCH] Bug 41248: Add ability for real time holds queue background > jobs to skip duplicate jobs (edit) > >It seems inefficient to rebuild the holds queue repeatedly for the same record. We should skip enqueuing BatchUpdateBiblioHoldsQueue jobs if there is already a queued job that hasn't started. > >Test Plan: >1) Enable real time holds queue >2) Ensure the default queue background job worker is not running >3) Set up 2 or more holds for the record >4) Alter the priority for those holds a couple times >5) Confirm only one new job is in the background_jobs table for that > record. >--- > Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.pm | 8 ++++++++ > 1 file changed, 8 insertions(+) > >diff --git a/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.pm b/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.pm >index 4a779f4c9c6..ed6180eaf3f 100644 >--- a/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.pm >+++ b/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.pm >@@ -19,6 +19,7 @@ use Modern::Perl; > > use Try::Tiny; > >+use Koha::BackgroundJobs; > use Koha::Biblios; > use Koha::Exceptions; > >@@ -134,6 +135,13 @@ sub enqueue { > > my @biblio_ids = @{ $args->{biblio_ids} }; > >+ # If any given bib has a specific job already queued, we can skip this job. Limited to single bib jobs for performance. >+ @biblio_ids = grep { >+ Koha::BackgroundJobs->count( { type => $self->job_type, status => 'new', data => qq/{"biblio_ids":["$_"]}/ } ) >+ == 0 >+ } @biblio_ids; >+ return unless @biblio_ids; >+ > $self->SUPER::enqueue( > { > job_size => scalar @biblio_ids, >-- >2.50.1 (Apple Git-155)
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 41248
:
189567
|
189569
|
189570
|
189571
|
189581
|
189582