Bugzilla – Attachment 164969 Details for
Bug 35899
Performance improvements for build_holds_queue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35899: don't perform expensive checks on non-local items when examining local items
Bug-35899-dont-perform-expensive-checks-on-non-loc.patch (text/plain), 2.66 KB, created by
Andreas Jonsson
on 2024-04-16 21:40:42 UTC
(
hide
)
Description:
Bug 35899: don't perform expensive checks on non-local items when examining local items
Filename:
MIME Type:
Creator:
Andreas Jonsson
Created:
2024-04-16 21:40:42 UTC
Size:
2.66 KB
patch
obsolete
>From 0783858a601f14da67f2aff87da25bd7f3fd2990 Mon Sep 17 00:00:00 2001 >From: Andreas Jonsson <andreas.jonsson@kreablo.se> >Date: Tue, 23 Jan 2024 10:09:05 +0100 >Subject: [PATCH] Bug 35899: don't perform expensive checks on non-local items > when examining local items > >--- > C4/HoldsQueue.pm | 30 ++++++++++++++++++++++-------- > 1 file changed, 22 insertions(+), 8 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index 957d40b991..9033032366 100644 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -452,18 +452,12 @@ sub MapItemsToHoldRequests { > my $LocalHoldsPriorityItemControl = > C4::Context->preference('LocalHoldsPriorityItemControl'); > >+ REQUEST: > foreach my $request (@$hold_requests) { >+ my $patron; > last if $num_items_remaining == 0; >- my $patron = Koha::Patrons->find($request->{borrowernumber}); >- next if $patron->category->exclude_from_local_holds_priority; >- > my $local_hold_match; > foreach my $item (@$available_items) { >- next if $item->{_object}->exclude_from_local_holds_priority; >- >- next unless _can_item_fill_request( $item, $request, $libraries ); >- >- next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber}; > > my $local_holds_priority_item_branchcode = > $item->{$LocalHoldsPriorityItemControl}; >@@ -480,6 +474,26 @@ sub MapItemsToHoldRequests { > $local_holds_priority_patron_branchcode; > > if ($local_hold_match) { >+ next if $item->{_object}->exclude_from_local_holds_priority; >+ >+ if ( !defined $patron ) { >+ $patron = Koha::Patrons->find( $request->{borrowernumber} ); >+ >+ next REQUEST if $patron->category->exclude_from_local_holds_priority; >+ } >+ >+ next unless _can_item_fill_request( $item, $request, $libraries ); >+ >+ next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber}; >+ >+ next >+ if $request->{item_group_id} >+ && $item->{_object}->item_group >+ && $item->{_object}->item_group->id ne $request->{item_group_id}; >+ >+ next >+ unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } ); >+ > if ( exists $items_by_itemnumber{ $item->{itemnumber} } > and not exists $allocated_items{ $item->{itemnumber} } > and not $request->{allocated}) >-- >2.39.2
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 35899
:
161358
|
161359
|
161360
| 164969 |
164970